Code Monkey home page Code Monkey logo

homework_fall2022's Introduction

homework_fall2022's People

Contributors

asap7772 avatar homerw avatar leo428 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homework_fall2022's Issues

Vectorizing env

With the LunarLander and HalfCheetah envs requiring single iteration batch sizes of > 10k for convergence, these runs take quite a long time. Gym allows multiprocessing for multiple envs at the same time in the form of the VectorEnv base class. Here's my proposal for an implementation of a vectorized environment to speed up batch sizes.

I would make a PR but the code in this repo contains many unfilled blanks (TODOs), some of which would need to be implemented in order to properly create a PR. Thus, I'm making an issue with the specified commits here.

An example of a test you can do is here. We run on the cartpole environment for 10 iterations with a batch size of 10000. We compare the single env and the vectorized env cases where we use 10 envs in the vectorized case.

Obviously the staff implementation and my implementation are different, but here are my outputs for the above test

# Without vectorization
real	1m17.553s
user	1m16.253s
sys	0m1.270s

# With vectorization, # of envs = 10
real	0m13.258s
user	0m13.899s
sys	0m2.867s

We achieve a speedup of ~6x. Let's say my LunarLander experiments take 2 hours to run. This would in theory reduce the time it takes to run the same experiment to 20 min, much more tractable, especially for students who typically only have access to CPU or colab GPUs.

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.