|
QDpy
|
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. | |
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.
| 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.
| 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.
| qdpy.rl.qd_dualdice.QDDualDICEJS.stats | ( | self | ) |
Return cumulative interactions and optimizer work.
Definition at line 246 of file qd_dualdice.py.
| qdpy.rl.qd_dualdice.QDDualDICEJS.train | ( | self, | |
| max_env_steps ) |
Spend another hard interaction budget on the current ensemble.
| max_env_steps | Number of additional calls to the real environment. |
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.