Skip to content

lehduong/Contrastive-Predictive-Coding-in-RL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pytorch Reinforcement Learning

This repository contains the code for policy gradient algorithm incorporating with credit assignment mechanism.

Install Dependencies

  1. Install Pytorch
pip install torch torchvision
  1. install Tensorflow 2
pip install tensorflow=2.2

or

pip install tensorflow-gpu=2.2
  1. Install OpenAI baseline (Tensorflow 2 version)
git clone https://github.com/openai/baselines.git -b tf2 && \
cd baselines && \
pip install -e .

Note: I haven't tested the code on Tensorflow 1 yet but it should work as well.

  1. Install gym
pip install 'gym[atari]'
  1. Install Park Platform. I modified the platform slightly to make it compatible with OpenAI's baseline.
git clone https://github.com/lehduong/park -b openai_baseline &&\
cd park && \
pip install -e .

Run experiments

python main.py --algo a2c --env-name PongNoFrameskip-v4

Acknowledgement

The started code is based on ikostrikov's repository