Git Product home page Git Product logo

esper's Introduction

return_transforms

This repository contains code for the following return transformation methods for Upside Down RL and Decision Transformer:

Installation Instructions

  • Install stochastic_offline_envs from here.
  • Install dependencies with pip install -r requirements.txt.
  • Make sure pytorch >= 1.10 is installed.
  • Install the package with pip install -e ..
  • Install the included decision_transformer package. This is only necessary if you want to use the transformed returns with the included modified decision transformer implementation.

Instructions for Decision Transformer

  • Run download_esper_datasets.py to save the stochastic_offline_envs datasets in a format that Decision Transformer understands.
  • Use the --rtg path/to/returns flag to use the generated returns or leave it out to use the original returns.

Usage

return_transforms operates on offline RL datasets. It saves a file with the transformed returns in the specified directory.

To use return_transforms on a dataset, run the following command:

python return_transforms/generate.py --env_name tfe --config configs/esper/tfe.yaml --device cuda --n_cpu 10 --ret_file data/tfe.ret

Then, you can use the included fork of Decision Transformer (in the decision_transformer directory) to train on the transformed returns.

python experiment.py --env tfe --dataset default -w True --max_iters 2 --num_steps_per_iter 25000 --rtg ../data/tfe.ret

Configurations are included for all included stochastic_offline_envs in the configs/esper directory.

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.