QDpy
Loading...
Searching...
No Matches
qdpy.rl.sac.SACPolicy Class Reference

Portable bounded Gaussian actor with an observation-dependent mean and scale. More...

Inheritance diagram for qdpy.rl.sac.SACPolicy:
qdpy.rl.policy.ContinuousPolicy qdpy.rl.policy._FlatPolicy

Public Member Functions

 save (self, path)
 Save a portable numeric actor without a simulator or optimizer.
 load (cls, path, *, device="cpu", seed=0)
 Restore the actor without constructing a learner or environment.
Public Member Functions inherited from qdpy.rl.policy._FlatPolicy
 act (self, observation, deterministic=True)
 Choose a deterministic action or sample from the actor.

Protected Member Functions

 _sample_actions (self, observations, generator)

Detailed Description

Portable bounded Gaussian actor with an observation-dependent mean and scale.

Map fixed Box observations to continuous actions with a squashed Gaussian.

The actor predicts a diagonal Gaussian mean and scale from the observation.
The act method uses the squashed mean by default. Set deterministic=False
to sample. Both paths restore the original Box shape, dtype and bounds.

:param observation_space: Fixed-shape numeric Gymnasium Box.
:param action_space: Finite floating-point Gymnasium Box.
:param config: Optional actor architecture as a PolicyConfig.
:param seed: Nonnegative seed for initialization and stochastic inference.
:param device: Torch CPU or CUDA device.

Definition at line 88 of file sac.py.

Member Function Documentation

◆ _sample_actions()

qdpy.rl.sac.SACPolicy._sample_actions ( self,
observations,
generator )
protected
Return reparameterized normalized actions and their joint log density.

Definition at line 113 of file sac.py.

◆ load()

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

Restore the actor without constructing a learner or environment.

Load a SAC actor with a fresh stochastic inference generator.

Reimplemented from qdpy.rl.policy.ContinuousPolicy.

Definition at line 139 of file sac.py.

◆ save()

qdpy.rl.sac.SACPolicy.save ( self,
path )

Save a portable numeric actor without a simulator or optimizer.

Write the architecture, bounds, and weights to a versioned NPZ file.

Reimplemented from qdpy.rl.policy.ContinuousPolicy.

Definition at line 133 of file sac.py.


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