Giter Site home page Giter Site logo

ricky-zhu / cycle_dynamics Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sjtuzq/cycle_dynamics

0.0 0.0 0.0 2.43 MB

[ICLR2021, Oral] Learning Cross-Domain Correspondence for Control with Dynamics Cycle-Consistency

Shell 0.06% Python 99.94%

cycle_dynamics's Introduction

Cycle-Dynamics

This repository contains the official implementation for Cycle-Dynamics introduced in the following paper:

Learning Cross-Domain Correspondence for Control with Dynamics Cycle-Consistency

Qiang Zhang, Tete Xiao, Alexei A. Efros, Lerrel Pinto, Xiaolong Wang

The project page with video is at https://sjtuzq.github.io/cycle_dynamics.html.

Citation

If you find our work useful in your research, please cite:

@article{zhang2020learning,
  title={Learning Cross-Domain Correspondence for Control with Dynamics Cycle-Consistency},
  author={Zhang, Qiang and Xiao, Tete and Efros, Alexei A and Pinto, Lerrel and Wang, Xiaolong},
  journal={arXiv preprint arXiv:2012.09811},
  year={2020}
}

Environment

  • Python 3.6
  • PyTorch 1.0 or higher, with NVIDIA CUDA Support
  • Other required python packages are specified by requirements.txt.

Prerequisites

  • Install Mujoco and other required packages.
  • Clone this repository.
  • Create the log folder './logs/cross_physics', './logs/cross_modality' and './logs/cross_morphology'.

Reproducing Cross-physics Experiment

1. Train the policy network, and collect the source domain data. Or you can download the pretrained policy weight here. Then place it in './logs/cross_physics/', unzip this file and collect the source domian data.

cd cross_physics/base_train_test/td3_solver
python train.py --env 'HalfCheetah-v2'
cd ../../cycle_transfer
python collect_data.py --data_type 'base' --data_id 1

2.Modify the xml file to change the environment, then collect data

cd cross_physics/base_train_test/mujoco_xml
python modify_xml.py --env 'half_cheetah' --phy 'arma3'
cd ../../cycle_transfer
python collect_data.py --data_type 'arma3' --data_id 1

3.Train the model to learn the correspondence

cd cross_physics/cycle_transfer
python forwardexp.py --data_type1 'base' --data_id1 1 --data_type2 'arma3' --data_id2 1

Reproducing Cross-modality Experiment

1. Train the policy network and collect the source domain data. Or you can download the pretrained policy weight here. Then place it in './logs/cross_modality/', unzip this file and collect the source domian data.

cd cross_modality/mujoco_exp/base_train_test/td3_solver
python train.py --env 'HalfCheetah-v2'

2.Collect the unpaired data for both domains.

cd cross_modality/mujoco_exp/cycle_transfer/
python collect_data.py --env 'HalfCheetah-v2' --data_type 'base' --data_id 1

3.Train the model to learn the correspondence.

cd cross_modality/mujoco_exp/cycle_transfer/
python cycleexp.py --data_type1 'base' --data_id1 1 --data_type2 'base' --data_id2 1

Reproducing Cross-morphology Experiment

1. Train the policy network and collect the source domain data. Or you can download the pretrained policy weight here. Then place it in './logs/cross_morphology/', unzip this file and collect the source domian data.

cd cross_morphology/base_train_test/td3_solver
python train.py --env 'HalfCheetah-v2'
cd ../../cycle_transfer
python collect_data.py --data_type 'base' --data_id 1

2.Modify the xml file to change the agent morphology.

cd cross_morphology/base_train_test/mujoco_xml
python modify_xml.py --env 'half_cheetah' --phy '3leg'
cd ../../cycle_transfer
python collect_data.py --data_type '3leg' --data_id 1

3.Train the model to learn the correspondence.

cd cross_morphology/cycle_transfer
python alignexp.py --data_type1 'base' --data_id1 1 --data_type2 '3leg' --data_id2 1

Reproducing Real Xarm Robot Experiment

Download the dataset here.

To train and evaluate the model:

cd realxarm_exp/xarm_pose
python main.py

Toy Experiment

The code for toy experiment is shown in the path './toys', which shows how we explore step by step to get the final framework. This part is not cleaned up but you can still have a reference if you are interested in.

cycle_dynamics's People

Contributors

ricky-zhu avatar sjtuzq 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.