Skip to main content

A plotter for reinforcement learning

Project description


PyPI GitHub GitHub last commit

This is a simple tool which can plot learning curves easily for reinforcement learning.


from PIP

pip install rl_plotter

from source

python3 install


First, add a logger in your code (for example: DQN):

from rl_plotter.logger import Logger

def train(name):
    dqn = DQN()
    logger = Logger(name, env_name='PongNoFrameskip-v4', use_tensorboard=False)

    while True:
        s = env.reset()
        while True:
            total_step = logger.add_step()
            a = dqn.select_action(s, EPSILON)
            s_, r, done, info = env.step(a)

            dqn.store_transition(s, a, r, s_)
            episode_reward += r

            if dqn.replay_memory.memory_counter > REPLAY_MEMORY_SIZE:
                loss = dqn.learn()
            if done:
            s = s_
        logger.add_reward(episode_reward, freq=10)

After the training or when you are training your agent, you can plot the learning curves in this way:

python -m rl_plotter.plotter

for help use:

python -m rl_plotter.plotter --help

The learning curves looks like this:

And you can custom the style of your curves by modifiying `rl_plotter.plotter`

To Do

  • [x] reinforcement learning plot tools
  • [x] timestamp features
  • [x] history experiment data plot tools
  • [ ] basic data plot tools锛坕ncluding ML-Loss plot锛墌
  • [ ] dynamic plot tools

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for rl-plotter, version 1.0.3
Filename, size File type Python version Upload date Hashes
Filename, size rl_plotter-1.0.3-py3-none-any.whl (12.4 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size rl_plotter-1.0.3.tar.gz (11.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page