Giter Club home page Giter Club logo

iql-pytorch's Introduction

Implicit Q-Learning (IQL) in PyTorch

This repository houses a minimal PyTorch implementation of Implicit Q-Learning (IQL), an offline reinforcement learning algorithm, along with a script to run IQL on tasks from the D4RL benchmark.

To install the dependencies, use pip install -r requirements.txt.

You can run the script like so:

python main.py --log-dir /path/where/results/will/go --env-name hopper-medium-v2 --tau 0.7 --beta 3.0

Note that the paper's authors have published their official implementation, which is based on JAX. My implementation is intended to be an alternative for PyTorch users, and my general recommendation is to use the authors' code unless you specifically want/need PyTorch for some reason.

I am validating my implementation against the results stated in the paper as compute permits. Below are results for the MuJoCo locomotion tasks, normalized return at the end of training, averaged (+/- standard deviation) over 3 seeds:

Environment This implementation Official implementation
halfcheetah-medium-v2 47.7 +/- 0.2 47.4
hopper-medium-v2 61.2 +/- 6.4 66.3
walker2d-medium-v2 78.7 +/- 4.5 78.3
halfcheetah-medium-replay-v2 42.9 +/- 1.7 44.2
hopper-medium-replay-v2 86.8 +/- 15.5 94.7
walker2d-medium-replay-v2 68.3 +/- 6.4 73.9
halfcheetah-medium-expert-v2 88.3 +/- 2.8 86.7
hopper-medium-expert-v2 76.6 +/- 34.9 91.5
walker2d-medium-expert-v2 108.7 +/- 2.2 109.6

We can see that the performance is mostly similar to what is stated in the paper, but slightly worse on a few tasks. Note that these results were obtained using a small simplification (deterministic policy and least-squares loss rather than a Gaussian distribution and negative log likelihood), which may explain the discrepancy.

iql-pytorch's People

Contributors

gwthomas 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.