Git Product home page Git Product logo

equi_q_corl21's Introduction

Equivariant Q Learning in Spatial Action Spaces

This repository contains the code of the paper Equivariant Q Learning in Spatial Action Spaces. Project website: https://pointw.github.io/equi_q_page.

Installation

  1. Install anaconda
  2. Clone this repo
    git clone https://github.com/pointW/equi_q_corl21.git
    cd equi_q_corl21
    
  3. Create and activate conda environment
    conda create --name equi_q python=3.7
    conda activate equi_q
    
    Note that this project was developed under pybullet version 2.7.1. Newer version of pybullet should also work, but it is not tested.
  4. Install PyTorch (Recommended: pytorch==1.7.0, torchvision==0.8.1)
  5. Install CuPy
  6. Install other requirement packages
    pip install -r requirements.txt
    
  7. Clone and install the environment repo
    git clone https://github.com/ColinKohler/helping_hands_rl_envs.git -b dian_corl21
    cd helping_hands_rl_envs
    pip install .
    cd ..
    
  8. Goto the scripts folder of this repo to run experiments
    cd scripts
    

Environment list

Change the [env] accordingly to run in each environment

3D Environments

  • Block Stacking: block_stacking
  • Bottle Arrangement: bottle_tray
  • House Building: house_building_4
  • Covid Test: covid_test
  • Box Palletizing: box_palletizing
  • Bin Packing: block_bin_packing

6D Environments

  • House Building: bumpy_house_building_4
  • Box Palletizing: bumpy_box_palletizing

Running Equivariant FCN

Gather expert demonstrations

python fill_buffer.py --alg=margin_fcn_si --env=[env] --heightmap_size=90 --num_rotations=6

Equivariant FCN with dynamic filter

python main.py --alg=margin_fcn_si --model=equ_resu_df_nout --equi_n=12 --env=[env] --heightmap_size=90 --num_rotations=6 

Equivariant FCN with lift expansion

python main.py --alg=margin_fcn_si --model=equ_resu_exp_nout --equi_n=12 --env=[env] --heightmap_size=90 --num_rotations=6 

Running Equivariant ASR

Gather expert demonstrations

python fill_buffer.py --alg=margin_asr --env=[env]

Equivariant ASR

python main.py --alg=margin_asr --model=equ_resu_df_flip --equi_n=4 --q2_model=equ_shift_df --env=[env]

Equivariant ASR variations

Equivariant ASR with Q1 using lift expansion (instead of dynamic filter)

python main.py --alg=margin_asr --model=equ_resu_exp_flip --equi_n=4 --q2_model=equ_shift_df --env=[env]

Equivariant ASR with Q1 in Cyclic Group C8 (instead of Dihedral group D4)

python main.py --alg=margin_asr --model=equ_resu_df --equi_n=8 --q2_model=equ_shift_df --env=[env]

Equivariant ASR with Q2 using deictic encoding (instead of equivariant network)

python main.py --alg=margin_asr_deictic --model=equ_resu_df_flip --equi_n=4 --q2_model=cnn --env=[env]

Running Equivariant ASR in SE(3)

Gather expert demonstrations

python fill_buffer.py --alg=margin_asr_5l_deictic35 --env=[env] --action_sequence=xyzrrrp --in_hand_mode=proj --patch_size=40

Equivariant ASR with Q2 using equivariant network and Q3-Q5 using deictic encoding

python main.py --alg=margin_asr_5l_deictic35 --model=equ_resu_df_flip --equi_n=4 --q2_model=equ_shift_df --env=[env] --load_aug_n=0 --action_sequence=xyzrrrp --in_hand_mode=proj --patch_size=40

Equivariant ASR with Q2-Q5 using deictic encoding

python main.py --alg=margin_asr_5l_deictic --model=equ_resu_df_flip --equi_n=4 --q2_model=cnn --env=[env] --load_aug_n=0 --action_sequence=xyzrrrp --in_hand_mode=proj --patch_size=40

Results

The training results will be saved under scripts/outputs

Citation

@inproceedings{
wang2021equivariant,
title={Equivariant \$Q\$ Learning in Spatial Action Spaces},
author={Dian Wang and Robin Walters and Xupeng Zhu and Robert Platt},
booktitle={5th Annual Conference on Robot Learning },
year={2021},
url={https://openreview.net/forum?id=IScz42A3iCI}
}

equi_q_corl21's People

Contributors

pointw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

equi_q_corl21's Issues

tag e2cnn==0.1.9 ?

Can it be that the most recent version of e2cnn is not compatible with equi_q_corl21 anymore?

When I run the main script (with different algos) with the most recent version of e2cnn, I received the following error:

Traceback (most recent call last):
  File "main.py", line 257, in <module>
    train()
  File "main.py", line 96, in train
    agent = createAgent()
  File "../scripts/create_agent.py", line 89, in createAgent
    fcn = EquResUDFRegNOut(1, num_primitives, domain_shape=(1, diag_length, diag_length), patch_shape=patch_shape, N=equi_n, n_middle_channels=(16, 32, 64, 128), kernel_size=3, quotient=False, last_quotient=True, initialize=initialize).to(device)
  File "../networks/equivariant_models.py", line 777, in __init__
    kernel_size=kernel_size, padding=kernel_size//2)
  File "../networks/r2conv_df.py", line 100, in __init__
    recompute=False)
TypeError: __init__() missing 1 required positional argument: 'points'

I see that e2cnn isn't tagged in the requirements.txt file. Would such tagging make sense?

Doucmentation of Model and Algorithm choice

Thanks for this wonderful repo and the great work!

When reading through the scripts/create_agent.py file, I wonder what the model and agent options correspond to, and how I can relate them to the experiments in the paper. For example, how does the model EquResUExpand differ from EquResUDFReg? Additionally, I try to understand how DQN3DFCNSingleIn differs from, say, DQN3DASRDeicticAug. Is there are description to understand these terms and how they relate to the experiments in the paper?

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.