QDpy
Loading...
Searching...
No Matches
qdpy.rl.qd_dualdice.QDDualDICEJS Class Reference

Train exportable Gymnasium policies using the QD-DualDICE-JS population update. More...

Public Member Functions

 stats (self)
 last_divergences (self)
 policies (self, *, device=None, seed=0)
 Export independent copies of the current actors.
 train (self, max_env_steps)
 Spend another hard interaction budget on the current ensemble.

Detailed Description

Train exportable Gymnasium policies using the QD-DualDICE-JS population update.

Apply reward and Jensen-Shannon Stein gradients to a policy ensemble.

A pair of neural networks estimates each directed occupancy ratio.
Evaluate the kernel and detached divergence pseudo-rewards on
current-policy trajectories. Use normalized, discounted score-function
policy gradients and apply every member's Stein update simultaneously.
A common implicit absorbing state represents completed episodes without
additional simulator calls.

:param env_factory: Callable creating one Gymnasium Box-observation environment.
:param population_size: Number of stochastic policies, at least two.
:param policy: Optional native PolicyConfig for the actors.
:param config: Optional QDDualDICEConfig for the estimator and kernel.
:param max_episode_steps: Finite rollout limit, treated as an episodic boundary.
:param seed: Private seed for actors, estimator, and environment resets.
:param device: PyTorch CPU or CUDA device.

Definition at line 199 of file qd_dualdice.py.

Member Function Documentation

◆ last_divergences()

qdpy.rl.qd_dualdice.QDDualDICEJS.last_divergences ( self)
Return the latest symmetric Jensen-Shannon estimates before the actor update.

Definition at line 251 of file qd_dualdice.py.

◆ policies()

qdpy.rl.qd_dualdice.QDDualDICEJS.policies ( self,
* ,
device = None,
seed = 0 )

Export independent copies of the current actors.

Return independent portable actors in stable ensemble order.

Definition at line 256 of file qd_dualdice.py.

◆ stats()

qdpy.rl.qd_dualdice.QDDualDICEJS.stats ( self)
Return cumulative interactions and optimizer work.

Definition at line 246 of file qd_dualdice.py.

◆ train()

qdpy.rl.qd_dualdice.QDDualDICEJS.train ( self,
max_env_steps )

Spend another hard interaction budget on the current ensemble.

Parameters
max_env_stepsNumber of additional calls to the real environment.
Returns
Cumulative QDDualDICEStats.
Train on completed episodes and keep unfinished panels across calls.

An episode cut by the step budget is counted and discarded.
Completed episodes remain in their panel until every actor has
supplied its configured number of episodes.

Definition at line 334 of file qd_dualdice.py.


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