Giter Club home page Giter Club logo

gonfreecshxh / a3c-rl-baseline-agent-for-grid2op-environment Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 5.0 2.06 MB

This A3C reinforcement learning code is implemented for tensorflow 2.0 and it is focused to demonstrate the implementation of a multi-threading agent (A3C) on [Grid2Op](https://github.com/rte-france/Grid2Op) environment.

License: MIT License

Python 100.00%
grid2op a3c grid2op-environment l2rpn-baselines python tensorflow2 keras-tensorflow

a3c-rl-baseline-agent-for-grid2op-environment's Introduction

Actor Critic (A3C) RL agent for Grid2Op environment

This is a python module that contains the A3C RL baseline agent for Grid2Op environment. This shows how the threading library can be used to train A3C algorithm specifically focused towards using the Grid2Op environment.

Authors

Authors: Kishan Prudhvi Guddanti, Amarsagar Reddy Ramapuram Matavalam, Yang Weng

Instal from PyPI

pip3 install l2rpn_baselines

Install from source

git clone https://github.com/rte-france/l2rpn-baselines.git
cd l2rpn-baselines
pip3 install -U .
cd ..
rm -rf l2rpn-baselines

Note: l2rpn-baselines module will install all the required python modules needed to run this A3C agent.

Usage

Please check the train.py and evaluate.py for a working example.

Note:

  1. The current A3C code is not optimized for performance on Grid2Op environment. It is only a demonstration for usage of A3C algorithm on Grid2Op environment. Good exploration strategy is needed for better performance.
  2. Currently (6/1/2020), we could not find an existing A3C agent code that is compatible with tensorflow version 2.0/Keras and there are some open issues - (Issue 1), (Issue 2, Nric's answer). We fixed these issues.

Important file descriptions.

"train.py" - Trains the RL agent.

"evaluate.py" - Evaluates the RL agent.

"run_grid2viz.py" - Visualizes the detailed performance of RL agent under various episodes (scenarios).

"user_environment_make.py" - Creates the environment. The user must use this file as a wrapper to create their environment and must not directly create the environment using grid2op.make() for the A3C code to create multiple environments. Alternatively, we strongly recommend check the MultiEnv inbuilt function from Grid2Op for future implementations.

a3c-rl-baseline-agent-for-grid2op-environment's People

Contributors

gonfreecshxh avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

a3c-rl-baseline-agent-for-grid2op-environment's Issues

Modifications for integration in l2rpn-baselines

Hello,

I have a few comments for the integration in the l2rpn-baselines, i will probably have some later on too ;-)

The first one is the name of your baseline, as of now it is called:

from l2rpn_baselines.Multithreading_agent.ActorCritic_Agent import ActorCritic_Agent

But as you might have noticed:

  • python names are "CamelCase" convention (at least for the exported class) so it would be nice to respect that (no underscore, uppercase at begining of words see Camel Case on wikipedia for example). This is cosmetics but for exported class i think it's better :-)
  • there is a name mismatch. If you name your Baseline Multithreading_agent then the name of the imported class should also be Multithreading_agent (and not ActorCritic_Agent) [see the example from l2rpn_baselines.MyContrib.MyContrib import MyContrib]
  • name of the baseline is itself a bit ambiguous. There tons of MultiThreading agent (A2C for example) so probably you might give a more personalized name, for example Geirina named their agent Geirina, or the Uni Kassel team named it "PandapowerOPFAgent" which is super explicit imho

The package cannot be imported once integrated in the baseline.
My recommendation would be to:

  • clone the l2rpn-baselines repository (git clone https://github.com/rte-france/l2rpn-baselines.git)
  • cd in the repo (cd l2rpn-baselines)
  • set up an empty virtual env (python -m virtualenv venv; source venv/bin/activate)
  • install l2rpn-balines from sources (pip install -e .) and don't install anything else
  • copy paste your actual repo in l2rpn_baselines (cp -R ../A3C-RL-baseline-agent-for-Grid2Op-environment l2rpn_baselines/Multithreading_agent)
  • try to import it from python:
from l2rpn_baselines.Multithreading_agent.ActorCritic_Agent import ActorCritic_Agent
from l2rpn_baselines.Multithreading_agent.ActorCritic_Agent import evaluate

These two should work out of the box

Once its working, copy paste back the content of l2rpn_baselines/A3C-RL-baseline-agent-for-Grid2Op-environment into your development github repository:
cp -R l2rpn_baselines/ActorCritic_Agent/* ../Multithreading_agent.ActorCritic_Agent import ActorCritic_Agent

and then commit and push it back :-)

Request for Version Dependency File

Hello, I'm very interested in your project. However, during my attempts to train it, I've noticed that the printed alive steps are fluctuating within a range of several tens of steps, without any clear training progress. I'm beginning to consider whether this issue is related to the library versions.

If possible, could you please provide the relevant version dependency file requirements.txt? This would help me to address potential version compatibility issues and gain a better understanding of the challenges that may arise during the training process.

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.