RRL: Resnet as representation for Reinforcement Learning

Related tags

Deep Learning RRL
Overview

Quick Links

Wesbite | Paper | Video

RRL: Resnet as representation for Reinforcement Learning

Resnet as representation for Reinforcement Learning (RRL) is a simple yet effective approach for training behaviors directly from visual inputs. We demonstrate that features learned by standard image classification models are general towards different task, robust to visual distractors, and when used in conjunction with standard Imitation Learning or Reinforcement Learning pipelines can efficiently acquire behaviors directly from proprioceptive inputs.

Final Behaviors acquired using RRL on ADROIT benchmark tasks (left to right) (a) Opening a door (b) Hammering a nail (c) Pen-twirling (d)) Object relocation All Tasks

Setup

RRL codebase can be installed by cloning this repository. Note that it uses git submodules to resolve dependencies. Please follow the steps as below to install correctly.

  1. Clone this repository along with the submodules

    git clone --recursive https://github.com/facebookresearch/RRL.git
    
  2. Install the package using conda. The dependencies (apart from mujoco_py) are listed in env.yml

    conda env create -f env.yml
    
    conda activate rrl
    
  3. The environment require MuJoCo as a dependency. You may need to obtain a license and follow the setup instructions for mujoco_py. Setting up mujoco_py with GPU support is highly recommended.

  4. Install mj_envs and mjrl repositories.

    cd RRL
    pip install -e mjrl/.
    pip install -e mj_envs/.
    pip install -e .
    
  5. Additionally, it requires the demonstrations published by hand_dapg

Running Instructions

  1. First step is to convert the observations of demonstrations provided by hand_dapg to the encoder feature space. An example script is provided here. Note the script saves the demonstrations in a .pickle format inside the rrl/demonstrations directory.

    For the mj_envs tasks :

    python convertDemos.py --env_name hammer-v0 --encoder_type resnet34 -c top -d 
         
    
         
    python convertDemos.py --env_name door-v0 --encoder_type resnet34 -c top -d 
         
    
         
    python convertDemos.py --env_name pen-v0 --encoder_type resnet34 -c vil_camera -d 
         
    
         
    python convertDemos.py --env_name relocate-v0 --encoder_type resnet34 -c cam1 -c cam2 -c cam3 -d 
         
    
         
  2. Launching RRL experiments using DAPG.

    An example launching script is provided job_script.py in the examples/ directory and the configs used are stored in the examples/config/ directory. Note : Hydra configs are used.

    python job_script.py  demo_file=
         
           --config-name hammer_dapg
    
         
    python job_script.py  demo_file=
         
           --config-name door_dapg
    
         
    python job_script.py  demo_file=
         
           --config-name pen_dapg
    
         
    python job_script.py  demo_file=
         
           --config-name relocate_dapg
    
         
You might also like...
NFT-Price-Prediction-CNN - Using visual feature extraction, prices of NFTs are predicted via CNN (Alexnet and Resnet) architectures.

NFT-Price-Prediction-CNN - Using visual feature extraction, prices of NFTs are predicted via CNN (Alexnet and Resnet) architectures.

In this project we use both Resnet and Self-attention layer for cat, dog and flower classification.
In this project we use both Resnet and Self-attention layer for cat, dog and flower classification.

cdf_att_classification classes = {0: 'cat', 1: 'dog', 2: 'flower'} In this project we use both Resnet and Self-attention layer for cdf-Classification.

Pretrained models for Jax/Haiku; MobileNet, ResNet, VGG, Xception.

Pre-trained image classification models for Jax/Haiku Jax/Haiku Applications are deep learning models that are made available alongside pre-trained we

Eff video representation - Efficient video representation through neural fields

Neural Residual Flow Fields for Efficient Video Representations 1. Download MPI

A resource for learning about deep learning techniques from regression to LSTM and Reinforcement Learning using financial data and the fitness functions of algorithmic trading

A tour through tensorflow with financial data I present several models ranging in complexity from simple regression to LSTM and policy networks. The s

Dense Contrastive Learning (DenseCL) for self-supervised representation learning, CVPR 2021.
Dense Contrastive Learning (DenseCL) for self-supervised representation learning, CVPR 2021.

Dense Contrastive Learning for Self-Supervised Visual Pre-Training This project hosts the code for implementing the DenseCL algorithm for se

 Viewmaker Networks: Learning Views for Unsupervised Representation Learning
Viewmaker Networks: Learning Views for Unsupervised Representation Learning

Viewmaker Networks: Learning Views for Unsupervised Representation Learning Alex Tamkin, Mike Wu, and Noah Goodman Paper link: https://arxiv.org/abs/2

pytorch implementation of
pytorch implementation of "Contrastive Multiview Coding", "Momentum Contrast for Unsupervised Visual Representation Learning", and "Unsupervised Feature Learning via Non-Parametric Instance-level Discrimination"

Unofficial implementation: MoCo: Momentum Contrast for Unsupervised Visual Representation Learning (Paper) InsDis: Unsupervised Feature Learning via N

Self-supervised learning on Graph Representation Learning (node-level task)

graph_SSL Self-supervised learning on Graph Representation Learning (node-level task) How to run the code To run GRACE, sh run_GRACE.sh To run GCA, sh

Comments
  • Docker image for adroit?

    Docker image for adroit?

    Hi! I'm just curious if you have been using docker containers to run experiments with Adroit? When I tried the rendering in a docker container (using a nvidia base image), it seems this line img = e.env.sim.render() can be very slow. And it is unclear what the reason is...

    If you have used docker then it would be great if you can share any information about the container you used... that would be really useful! Really appreciate your help!

    opened by watchernyu 2
  • Demonstration has no seed?

    Demonstration has no seed?

    Hi! I noticed that when converting the demonstrations, it will give this warning message.

    "++++++++++++++++++++++++++++ Couldn't find the seed of the demos. Please verify."

    When I print out the keys of the loaded demonstration file (using the commands below), it seems that the demonstrations don't really have the "seed" entry (I downloaded from the dapg repo), I'm not sure if this is the expected behavior? Thank you very much!

    import pickle
    demo_paths = pickle.load(open('relocate-v0_demos.pickle', 'rb'))
    print(len(demo_paths))
    print(demo_paths[0].keys())
    
    # output is: 
    # 25
    # dict_keys(['observations', 'init_state_dict', 'actions', 'rewards'])
    
    opened by watchernyu 2
  • Using cpu for testing?

    Using cpu for testing?

    First of all thank you very much for presenting this nice paper and open source the code!

    I'm wondering if it's possible to use cpu instead of gpu to do some testing on my local machine (which unfortunately does not have a cuda gpu)? I tried to modify the code a bit and run (I have the demo files under ../demo)

    python convertDemos.py --env_name hammer-v0 --encoder_type resnet34 -c top -d ../demo/hammer-v0_demos.pickle

    Then it gives me the following error, ERROR: GLEW initalization error: Missing GL version which occurs at the rendering line in multicam.py: img = self._env.env.sim.render(width=self.width, height=self.height, mode='offscreen', camera_name=cam)

    Is there an easy way to ask mujoco to do cpu rendering here (software rendering)? Thanks a lot for the help!

    opened by watchernyu 2
  • How to turn on visual distractions?

    How to turn on visual distractions?

    Hi! I'm curious on how can we turn on the visual distractions such as light position, direction, object color etc. in the Adroit environment? (as mentioned in section 7.5 in the appendix of your paper)

    Thanks a lot for your help!

    opened by watchernyu 0
Owner
Meta Research
Meta Research
3D ResNet Video Classification accelerated by TensorRT

Activity Recognition TensorRT Perform video classification using 3D ResNets trained on Kinetics-400 dataset and accelerated with TensorRT P.S Click on

Akash James 39 Nov 21, 2022
Quickly comparing your image classification models with the state-of-the-art models (such as DenseNet, ResNet, ...)

Image Classification Project Killer in PyTorch This repo is designed for those who want to start their experiments two days before the deadline and ki

null 349 Dec 8, 2022
Pretrained models for Jax/Flax: StyleGAN2, GPT2, VGG, ResNet.

Pretrained models for Jax/Flax: StyleGAN2, GPT2, VGG, ResNet.

Matthias Wright 169 Dec 26, 2022
improvement of CLIP features over the traditional resnet features on the visual question answering, image captioning, navigation and visual entailment tasks.

CLIP-ViL In our paper "How Much Can CLIP Benefit Vision-and-Language Tasks?", we show the improvement of CLIP features over the traditional resnet fea

null 310 Dec 28, 2022
PyTorch implementation of the R2Plus1D convolution based ResNet architecture described in the paper "A Closer Look at Spatiotemporal Convolutions for Action Recognition"

R2Plus1D-PyTorch PyTorch implementation of the R2Plus1D convolution based ResNet architecture described in the paper "A Closer Look at Spatiotemporal

Irhum Shafkat 342 Dec 16, 2022
PyTorch implementation of MoCo v3 for self-supervised ResNet and ViT.

MoCo v3 for Self-supervised ResNet and ViT Introduction This is a PyTorch implementation of MoCo v3 for self-supervised ResNet and ViT. The original M

Facebook Research 887 Jan 8, 2023
Base pretrained models and datasets in pytorch (MNIST, SVHN, CIFAR10, CIFAR100, STL10, AlexNet, VGG16, VGG19, ResNet, Inception, SqueezeNet)

This is a playground for pytorch beginners, which contains predefined models on popular dataset. Currently we support mnist, svhn cifar10, cifar100 st

Aaron Chen 2.4k Dec 28, 2022
Reproduces ResNet-V3 with pytorch

ResNeXt.pytorch Reproduces ResNet-V3 (Aggregated Residual Transformations for Deep Neural Networks) with pytorch. Tried on pytorch 1.6 Trains on Cifar

Pau Rodriguez 481 Dec 23, 2022
DeepLab resnet v2 model in pytorch

pytorch-deeplab-resnet DeepLab resnet v2 model implementation in pytorch. The architecture of deepLab-ResNet has been replicated exactly as it is from

Isht Dwivedi 601 Dec 22, 2022
Reproduce ResNet-v2(Identity Mappings in Deep Residual Networks) with MXNet

Reproduce ResNet-v2 using MXNet Requirements Install MXNet on a machine with CUDA GPU, and it's better also installed with cuDNN v5 Please fix the ran

Wei Wu 531 Dec 4, 2022