Coder Social home page Coder Social logo

rl_assignments's Introduction

RL Assignments

Template code for reinforcement learning assignments.

Getting Started

Install requirements:

conda create -n rl python=3.8
conda activate rl
pip install -r requirements.txt

and it should be good to go.

Train Models

To train a policy, run the following command:

python run.py --env_config data/envs/dm_cheetah.yaml --agent_config a2/dm_cheetah_cem_agent.yaml --mode train --log_file output/log.txt --out_model_file output/model.pt --visualize

  • --env_config specifies the configuration file for the environment.
  • --agent_config specifies configuration file for the agent.
  • --visualize enables visualization. Rendering should be disabled for faster training.
  • --log_file specifies the output log file, which will keep track of statistics during training.
  • --out_model_file specifies the output model file, which contains the model parameters.

Test Models

To load a trained model, run the following command:

python run.py --env_config data/envs/dm_cheetah_env.yaml --agent_config a2/dm_cheetah_cem_agent.yaml --mode test --model_file data/models/dm_cheetah_ppo_model.pt --visualize

  • --model_file specifies the .pt file that contains parameters for the trained model. Pretrained models are available in data/models/.

Visualizing Training Logs

During training, a tensorboard events file will be saved the same output directory as the log file. The log can be viewed with:

tensorboard --logdir=output/ --port=6006 --bind_all

The output log .txt file can also be plotted using the plotting script in tools/plot_log/plot_log.py.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.