Run 🏃
After dependencies are installed, you can run the algorithm file directly.
python abcdrl/dqn_torch.py \
--env-id Cartpole-v1 \
--total_timesteps 500000 \ #(1)!
--gamma 0.99 \
--learning-rate 2.5e-4 \ #(2)!
--capture-video True \
--track \ #(3)!
--wandb-project-name 'abcdrl' \
--wandb-tags "['tag1', 'tag2']"
- The connector can use
_or- - or
0.00025 - or
--track True
Set specific GPU device
- Using
gpu:0andgpu:1👇CUDA_VISIBLE_DEVICES="0,1" python abcdrl/dqn_torch.py --cuda
- Using
gpu:1👇CUDA_VISIBLE_DEVICES="1" python abcdrl/dqn_torch.py --cuda
- Using
cpuonly 👇python abcdrl/dqn_torch.py --cuda FalseCUDA_VISIBLE_DEVICES="" python abcdrl/dqn_torch.pyCUDA_VISIBLE_DEVICES="-1" python abcdrl/dqn_torch.py
Parameters in the algorithm file, consisting of two parts. The first part is the initialization parameters of Trainer🔁, and the second part is the parameters of the feature (logger, ...).
| abcdrl/dqn_torch.py | |
|---|---|
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | |
| abcdrl/dqn_torch.py | |
|---|---|
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | |
Note
You can use the python abcdrl/dqn_torch.py --help command to view algorithm parameters and the python abcdrl/dqn_torch.py __call__ --help command to view features parameters.
Last update:
2023-01-11