candle/candle-examples/examples/reinforcement-learning
Laurent Mazare b20acd622c
Update for pyo3 0.21. (#1985)
* Update for pyo3 0.21.

* Also adapt the RL example.

* Fix for the pyo3-onnx bindings...

* Print details on failures.

* Revert pyi.
2024-04-01 17:07:02 +02:00
..
README.md Add Policy Gradient to Reinforcement Learning examples (#1500) 2023-12-30 09:01:29 +01:00
atari_wrappers.py Fix a couple typos (#1451) 2023-12-17 05:20:05 -06:00
ddpg.rs Detach the tensors on batch-norm eval. (#1702) 2024-02-13 14:26:32 +01:00
dqn.rs Add a DQN example to the reinforcement-learning section (#1872) 2024-03-18 21:22:53 +01:00
gym_env.rs Update for pyo3 0.21. (#1985) 2024-04-01 17:07:02 +02:00
main.rs Apply rustfmt. (#1873) 2024-03-18 21:43:31 +01:00
policy_gradient.rs Detach the tensors on batch-norm eval. (#1702) 2024-02-13 14:26:32 +01:00
vec_gym_env.rs Update for pyo3 0.21. (#1985) 2024-04-01 17:07:02 +02:00

README.md

candle-reinforcement-learning

Reinforcement Learning examples for candle.

This has been tested with gymnasium version 0.29.1. You can install the Python package with:

pip install "gymnasium[accept-rom-license]"

In order to run the examples, use the following commands. Note the additional --package flag to ensure that there is no conflict with the candle-pyo3 crate.

For the Policy Gradient example:

cargo run --example reinforcement-learning --features=pyo3 --package candle-examples -- pg

For the Deep Deterministic Policy Gradient example:

cargo run --example reinforcement-learning --features=pyo3 --package candle-examples -- ddpg