All Projects → UBCMOCCA → SymmetricRL

UBCMOCCA / SymmetricRL

Licence: other
Repo for "On Learning Symmetric Locomotion"

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to SymmetricRL

clustered forward demo vk
Clustered forward rendering demo with Vulkan
Stars: ✭ 50 (+66.67%)
Mutual labels:  computer-graphics
HOT
Hierarchical Optimization Time Integration (HOT) for efficient implicit timestepping of the material point method (MPM)
Stars: ✭ 83 (+176.67%)
Mutual labels:  computer-graphics
chainer-pix2pix
Chainer implementation for Image-to-Image Translation Using Conditional Adversarial Networks
Stars: ✭ 40 (+33.33%)
Mutual labels:  computer-graphics
voxel-builder
Voxel-based 3D modeling application
Stars: ✭ 31 (+3.33%)
Mutual labels:  symmetry
TermGL
2D & 3D graphics engine in the terminal [C/C++]
Stars: ✭ 219 (+630%)
Mutual labels:  computer-graphics
PointCloudRegistrationTool
Automatically registers (aligns) and visualizes point clouds, or processes a whole bunch at once
Stars: ✭ 82 (+173.33%)
Mutual labels:  computer-graphics
Libwethair
A Multi-Scale Model for Simulating Liquid-Hair Interactions
Stars: ✭ 232 (+673.33%)
Mutual labels:  computer-graphics
Ray-Tracer
Simple Ray Tracer
Stars: ✭ 18 (-40%)
Mutual labels:  computer-graphics
FastMassSpring
Interactive cloth simulator using the method described in the SIGGRAPH paper "Fast Simulation of Mass-Spring Systems" by Liu, T., Bargteil, A. W., Obrien, J. F., & Kavan, L.
Stars: ✭ 170 (+466.67%)
Mutual labels:  computer-graphics
odak
🔬 Scientific computing library for optics 🔭, computer graphics 💻 and visual perception 👀
Stars: ✭ 99 (+230%)
Mutual labels:  computer-graphics
CompenNet
[CVPR'19] End-to-end Projector Photometric Compensation
Stars: ✭ 35 (+16.67%)
Mutual labels:  computer-graphics
Photon-v2
A program that takes photographs of a virtual world.
Stars: ✭ 75 (+150%)
Mutual labels:  computer-graphics
CycleGAN-gluon-mxnet
this repo attemps to reproduce Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks(CycleGAN) use gluon reimplementation
Stars: ✭ 31 (+3.33%)
Mutual labels:  computer-graphics
t-rex
A Chrome T-Rex game remake using javascript and threejs. Online demo: https://rossning92.github.io/t-rex
Stars: ✭ 89 (+196.67%)
Mutual labels:  computer-graphics
photon mapping
minimal but extensible header only implementation of photon mapping in C++
Stars: ✭ 65 (+116.67%)
Mutual labels:  computer-graphics
Usd Resources
A curated list of USD projects and resources
Stars: ✭ 250 (+733.33%)
Mutual labels:  computer-graphics
C-Raytracer
A CPU raytracer from scratch in C
Stars: ✭ 49 (+63.33%)
Mutual labels:  computer-graphics
mesh-deform
🍭 Physically plausible interactive 3D mesh deformation based on as rigid as possible constraints.
Stars: ✭ 67 (+123.33%)
Mutual labels:  computer-graphics
computer-vision-notebooks
👁️ An authorial set of fundamental Python recipes on Computer Vision and Digital Image Processing.
Stars: ✭ 89 (+196.67%)
Mutual labels:  computer-graphics
Exploring-SceneKit
👾 An app created to explorer the features of SceneKit iOS framework. Assets load (Model I/O), interaction, animation, classical rendering (Blinn-Phong), physically based rendering.
Stars: ✭ 52 (+73.33%)
Mutual labels:  computer-graphics

On Learning Symmetric Locomotion

Installation

There is no need for compilation. You can install all requirements using Pip, however, you might prefer to install some manully, including:

Installation using Pip

# TODO: create and activate your virtual env of choice

# download the repo as well as the submodules (including )
git clone https://github.com/UBCMOCCA/SymmetricRL --recurse-submodules

cd SymmetricRL
pip install -r requirements  # you might prefer to install some packages (including PyTorch) yourself

There is also a helper script in setup/setup_cc.sh that can be used to install the requirements on Compute Canada.

Running Locally

To run an experiment named test_experiment with the PyBullet humanoid environment you can run:

./scripts/local_run_playground_train.sh  w2_test_experiment  env_name='pybullet_envs:Walker2DBulletEnv-v0'

# run the same experiment with the NET architecture symmetry method (other options include "traj, loss, phase, net2")
./scripts/local_run_playground_train.sh  w2_net_experiment  env_name='pybullet_envs:Walker2DBulletEnv-v0' mirror_method='net'

The w2_net_experiment is the name of the experiment. This command will create a new experiment directory inside the runs directory that contains the following files:

  • pid: the process ID of the task running the training algorithm
  • progress.csv: a CSV file containing the data about the the training progress
  • slurm.out: the output of the process. You can use tail -f to view the contents
  • configs.json: a JSON file containing all the hyper-parameter values used in this run
  • run.json: extra useful stuff about the run including the host information and the git commit ID (only works if GitPython is installed)
  • models: a directory containing the saved models

In case you use Compute Canada you also use the other scripts like cedar_run_playground_train.sh to create a batch job. These scripts use the same argument sctructure but also allow you to run the same task with multiple replicates using the num_replicates variable.

Plotting Results

The plot_from_csv.py script can be helpful for plotting the learning curves:

python -m playground.plot_from_csv --load_paths runs/*/*/  --columns mean_rew max_rew  --smooth 2

# to group the results based on the name
python -m playground.plot_from_csv --load_paths runs/*/*/  --columns mean_rew max_rew  --name_regex ".*__([^_\/])*" --group 1
  • The load_paths argument specifies which directories the script should look into
  • It opens the progress.csv file and plots the columns as the y-axis and uses the row for the x-axis (defaults to total_num_steps)
  • You can also provide a name_regex to make the figure legends simpler and more readable, e.g. --name_regex 'walker-(.*)mirror\/' would turn runs/2019_07_08__23_53_20__walker-lossmirror/1 to simply loss.
  • group can be used to aggregate the results of multiple runs of the same experiment into one. name_regex is used to specify the groups.

Running Learned Policy

The enjoy.py script can be used to run a learned policy and render the results:

python -m playground.enjoy with experiment_dir=runs/<EXPERIMENT_DIRECTORY>

# plot the joint positions over time
python -m playground.evaluate with experiment_dir=runs/<EXPERIMENT_DIRECTORY> plot=True

Evaluating Results

The evaluate.py script is used for evaluating learned policies. The results will be saved to a new file called evaluate.json inside the experiment_dir where the policy was loaded from.

# evaluate with 10000 steps
python -m playground.evaluate with experiment_dir=runs/<EXPERIMENT_DIRECTORY> max_steps=10000
# with rendering
python -m playground.evaluate with experiment_dir=runs/<EXPERIMENT_DIRECTORY> render=True

# evaluate all experiments
for d in runs/*/*/; do python -m playground.evaluate with experiment_dir=$d; done

Metrics (will be expanded):

  • Symmetric Index (joint angle and torque)
    • Uses the MetricsEnv environment wrapper from symmetric/metric_utils.py

NOTE: the current script assumes that the environment has a similar interface to PyBullet locomotion environments. It assumes the following parameters are present in the unwrapped environment:

  • robot.feet_contact
  • robot.ordered_joints
    • The joint names that have the word left in them are assumed to be on the left side. Any other joint that does not contain the word abdomen is assumed to be on the right side.

The environments that are currently tested and supported:

  • Walker2DBulletEnv
  • HumanoidBulletEnv
  • Walker3DCustomEnv
  • Walker3DStepperEnv

Citation

Please cite the following paper if you found our work useful. Thanks!

Farzad Adbolhosseini and Hung Yu Ling and Zhaoming Xie and Xue Bin Peng and Michiel van de Panne. "On Learning Symmetric Locomotion", Proc. ACM SIGGRAPH Motion, Interaction, and Games (MIG 2019).

@inproceedings{2019-MIG-symmetry,
  title={On Learning Symmetric Locomotion},
  author={Farzad Adbolhosseini and Hung Yu Ling and Zhaoming Xie and Xue Bin Peng and Michiel van de Panne},
  booktitle = {Proc. ACM SIGGRAPH Motion, Interaction, and Games (MIG 2019)},
  year={2019}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].