GithubHelp home page GithubHelp logo

robertyin-sa / prioritized-experience-replay Goto Github PK

View Code? Open in Web Editor NEW

This project forked from damcy/prioritized-experience-replay

0.0 1.0 0.0 11 KB

implement of prioritized experience replay

License: MIT License

Python 100.00%

prioritized-experience-replay's Introduction

Prioritized Experience Replay

Usage

  1. in rank_base.py Experience.stroe give a simple description of store replay memory, or you can also refer rank_base_test.py
  2. It's more convenient to store replay as format (state_1, action_1, reward, state_2, terminal). If we use this method, all replay memory in Experience are legal and can be sampled as we like.
  3. run it with python3

Rank-based

use binary heap tree as priority queue, and build an Experience class to store and retrieve the sample

Interface:
* All interfaces are in rank_based.py
* init conf, please read Experience.__init__ for more detail, all parameters can be set by input conf
* replay sample store: Experience.store
	params: [in] experience, sample to store
	returns: bools, True for success, False for failed
* replay sample sample: Experience.sample
	params: [in] global_step, used for cal beta
	returns: 
		experience, list of samples
		w, list of weight
		rank_e_id, list of experience's id, used for update priority value
* update priority value: Experience.update
	params: 
		[in] indices, rank_e_ids
		[in] delta, new TD-error

Proportional

you can find the implementation here: proportional

Reference

  1. "Prioritized Experience Replay" http://arxiv.org/abs/1511.05952
  2. Atari by @Kaixhin, Atari uses torch to implement rank-based algorithm.

Application

  1. TEST1 PASSED: These code has been applied to my own NLP DQN experiment, it significantly improves performance.

prioritized-experience-replay's People

Contributors

damcy avatar

Watchers

James Cloos 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.