Git Product home page Git Product logo

andes_gym's Introduction

andes_gym

Andes environment for OpenAI Gym

  • Free software: GPL v3+

Installation

Create an empty conda environment with

conda create -n drl-andes python=3.8

Install ANDES

The detailed instruction of Andes installation can be found here.

conda config --add channels conda-forge
conda config --set channel_priority flexible

Use conda install instead of pip install for andes installation

conda install andes

or in the root directory of andes, run

conda install --file requirements.txt
conda install --file requirements-dev.txt
python3 -m pip install -e .

Test if andes has been successfully installed by

andes selftest

Install GYM

Install mpi4py from Intel with

conda install -c intel mpi4py

Install gym

pip install gym

Install a recent version of ANDES with

Stable-baselines supporting tensorflow

Install tensorflow (cpu version)

pip install andes==1.5.8

Install keras

pip install keras

Install stable-baselines or stable-baselines3 Refer to the stable-baselines website or stable-baselines3 for detailed instruction.

For stable-baselines

Option 1: First Homebrew will be needed. Then, install the dependencies of stable-baselines as

brew install cmake openmpi

Then, open the stable-baselines repo, cd to the directory and

pip install -e .

Option 2:

pip install stable-baselines

Stable-baselines supporting pytorch

For stable-baselines3 (uses Pytorch 1.7)

pip install stable-baselines3

or in the root directory

pip install -e .

Install andes_gym

In the root directory of andes_gym , install andes_gym in the development mode with

pip install -e .

Examples

Try out examples in the folder examples .

Edit the number of time steps in train_freq_ddpg.py to a proper value. The larger the value, the longer it takes to simulate and train.

Run the example with

python train_freq_ddpg.py

Some deprecation warnings can be safely ignored.

When the training is completed, replay the trained model with

python play_freq_ddpg.py

You may need to install additional packages, such as matplotlib, to show the visualization. The matplotlib window might appear frozen, but is actually refreshed after each run.

Performance Tips

While most of the computation time was spent in ANDES, tests show that Linux perform consistently better than Windows, especially with cvxoptklu installed.

Currently, it is difficult to install cvxoptklu on Windows. Therefore, a Linux box is recommended whenever possible.

Some algorithms can take advantage of multi-core processors but most cannot. Please check the algorithm documentation from stable-baselines to verify. A quick way to check if an algorithm is taking advantage of your multi-core processor is to check the utilization of CPU (in Windows Task Manager or in htop of Linux).

Version Control

When working on the source code, please branch from master and work on your own branch.

You can either use GitHub for Desktop or learn the commands. The following are some commands for quick reference.

Branching can be done the collowing command

git checkout -b YOUR_BRANCH_NAME

where YOUR_BRANCH_NAME is the branch name of your choice.

To stage changes, use

git add PATH_TO_FILE

To commit changes, use

git commit

To push to a not-yet-exising branch, use

git push -u origin YOUR_BRANCH_NAME

After the first push, your local git will memorize the tracking branch. Next time, you can simply push with

git push

Features

  • TODO

andes_gym's People

Contributors

cuihantao avatar whoiszyc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.