QDpy
Loading...
Searching...
No Matches
qdpy.rl.policy.ContinuousPolicy Class Reference

A bounded Box actor for evolutionary, on-policy, and deterministic control. More...

Inheritance diagram for qdpy.rl.policy.ContinuousPolicy:
qdpy.rl.policy._FlatPolicy qdpy.rl.masqd.TeamPolicy qdpy.rl.refqd._DecisionActor qdpy.rl.sac.SACPolicy qdpy.rl.madecm.MADECMPolicy

Public Member Functions

 save (self, path)
 Store a versioned continuous actor without optimizer state.
 load (cls, path, *, device="cpu", seed=0)
 Load a continuous actor without constructing its environment.
Public Member Functions inherited from qdpy.rl.policy._FlatPolicy
 act (self, observation, deterministic=True)
 Choose a deterministic action or sample from the actor.

Detailed Description

A bounded Box actor for evolutionary, on-policy, and deterministic control.

Apply tanh and scale each output into its environment action interval.

Hidden layers use ReLU. A stochastic actor learns a state-independent
diagonal Gaussian scale in the coordinates before tanh. Its log
standard deviation is clamped to [-12, 2] for float32 sampling. A deterministic
actor always uses the squashed mean, including when ``deterministic=False``.

:param observation_space: Numeric Gymnasium Box with a fixed shape.
:param action_space: Floating-point Gymnasium Box with finite bounds.
:param config: Optional :class:`PolicyConfig` with hidden-layer widths.
:param stochastic: Include a trainable log standard deviation per coordinate.
:param seed: Nonnegative seed for initialization and stochastic actions.
:param device: Torch CPU or CUDA device.

Definition at line 337 of file policy.py.

Member Function Documentation

◆ load()

qdpy.rl.policy.ContinuousPolicy.load ( cls,
path,
* ,
device = "cpu",
seed = 0 )

Load a continuous actor without constructing its environment.

Restore the actor, action bounds, shape, and floating-point dtype.

Reimplemented in qdpy.rl.masqd.TeamPolicy, and qdpy.rl.sac.SACPolicy.

Definition at line 433 of file policy.py.

◆ save()

qdpy.rl.policy.ContinuousPolicy.save ( self,
path )

Store a versioned continuous actor without optimizer state.

Write a portable numeric NPZ file at the supplied path.

Reimplemented in qdpy.rl.masqd.TeamPolicy, and qdpy.rl.sac.SACPolicy.

Definition at line 423 of file policy.py.


The documentation for this class was generated from the following file: