rical730 f5a0d0d0d1 | 3 years ago | |
---|---|---|
.. | ||
README.md | 3 years ago | |
atari.py | 4 years ago | |
atari_agent.py | 4 years ago | |
atari_model.py | 4 years ago | |
atari_wrapper.py | 4 years ago | |
dqn.py | 4 years ago | |
parallel_run.py | 3 years ago | |
replay_memory.py | 4 years ago | |
rom_files | 4 years ago | |
utils.py | 4 years ago |
Use parl.compile to train the model parallelly. When applying offline training or dataset is too large to train on a single GPU, we can use parallel computing to accelerate training.
# Set CUDA_VISIBLE_DEVICES to select which GPUs to train
import parl
import paddle.fluid as fluid
learn_program = fluid.Program()
with fluid.program_guard(learn_program):
# Define your learn program and training loss
pass
learn_program = parl.compile(learn_program, loss=training_loss)
# Pass the training loss to parl.compile. Distribute the model and data to GPUs.
We provide a demonstration of offline Q-learning with parallel executing, in which we seperate the procedures of collecting data and training the model. First we collect data by interacting with the environment and save them to a replay memory file, and then fit and evaluate the Q network with the collected data. Repeat these two steps to improve the performance gradually.
# Collect training data
python parallel_run.py --rom rom_files/pong.bin
# Train the model offline with multi-GPU
python parallel_run.py --rom rom_files/pong.bin --train
PARL 是一个高性能、灵活的强化学习框架
Python C++ JavaScript Markdown Shell other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》