Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/VincentYu68/SymmetryCurriculumLocomotion
19 June 2024, 13:49:32 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
Revision 40eed6ce7de7664f786d392ac062be7db49ff6c0 authored by Wenhao Yu on 09 August 2018, 13:29:50 UTC, committed by GitHub on 09 August 2018, 13:29:50 UTC
Update README.md
1 parent 0669179
  • Files
  • Changes
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • 40eed6ce7de7664f786d392ac062be7db49ff6c0
    No releases to show
  • 2a8c964
  • /
  • README.md
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
  • snapshot
origin badgerevision badge
swh:1:rev:40eed6ce7de7664f786d392ac062be7db49ff6c0
origin badgedirectory badge
swh:1:dir:2a8c964cf370d90e812da79f59e431408df11b29
origin badgecontent badge
swh:1:cnt:635fc520bed3cb561fa96f8b708c2039891e5590
origin badgesnapshot badge
swh:1:snp:5c020c91964c1d071f5051f08dcb7bf5f940ca20

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 40eed6ce7de7664f786d392ac062be7db49ff6c0 authored by Wenhao Yu on 09 August 2018, 13:29:50 UTC
Update README.md
Tip revision: 40eed6c
README.md
# Learning Symmetric and Low-energy Locomotion

This is code for our paper: https://arxiv.org/abs/1801.08093

## Setup

The code consists of two parts: dart-env, which is an extension of OpenAI Gym that uses Dart for rigid-body simulation, and baselines, which is adapted from OpenAI Baselines.

To install dart-env, follow the instructions at: https://github.com/DartEnv/dart-env/wiki.

To install baselines, execute the following:

```bash
cd baselines
pip install -e .
```


## How to use

To test the code on a biped walking robot, run the following command from the project directory:

```bash
mpirun -np 8 python -m baselines.ppo1.run_walker3d_staged_learning
```

The training results will be saved to data/. The final policy is saved as policy_params.pkl. You can also find the intermediate policies in the folders organized by the corresponding curriculums. To test a policy, run:

```bash
python test_policy.py ENV_NAME PATH_TO_POLICY
```

To visualize the learning curve, run:

```bash
python plot_benchmark.py PATH_TO_FOLDER
```



### Setup environment

4 example environments are included: [DartWalker3d-v1](dart-env/gym/envs/dart/walker3d.py), [DartHumanWalker-v1](dart-env/gym/envs/dart/human_walker.py), [DartDogRobot-v1](dart-env/gym/envs/dart/dog_robot.py) and [DartHexapod-v1](dart-env/gym/envs/dart/hexapod.py).

The desired velocity is controlled by three variables in the initialization of each environment: **init_tv** sets the target velocity at the beginning of the rollout, **final_tv** sets the target velocity we want the character to reach eventually, and **tv_endtime** sets the amount of time (in seconds) it takes to accelerate from **init_tv** to **final_tv**.

### Setup training script

Refer to [run_walker3d_staged_learning.py](baselines/baselines/ppo1/run_walker3d_staged_learning.py) for an example on how to setup the training script for the biped walking robot.

#### Mirror-symmetry 

The mirror-symmetry loss for a new environment is configured with the argument **observation_permutation** and **action_permutation** when initializing MlpMirrorPolicy in the training script.

For **observation_permutation** and **action_permutation**, they are two vectors used for mirror symmetric loss. Each entry in these two denotes the index of the corresponding entry in observation/action AFTER it is mirrored w.r.t the sagittal plane of the character, and the sign of the element means whether the entry should multiply -1 after mirroring. For example, if a character has its left and right elbow joint angle at index 4 and 7 of the obsevation vector, then observation_permutation[4] should be 7 and observation_permutation[7] should be 4. Further, if the behavior of the two dofs are opposite, e.g. larger value of left elbow angle means flexion while larger value of right elbow angle means extension, then a -1 should be multiplied to both entries in observation_permutation. Note that for dofs at the center of the character (like pelvis rotation), their corresponding mirrored entry are simply themselves, with -1 multiplied to some of them. Also, if the entry at index 0 need to be negated, you need to use a small negative value like -0.0001, as multiplying -1 wouldn't change 0.

## Additional notes

For a newly created dart-env environment, you can use [examine_skel.py](baselines/examine_skel.py) to test the model configurations, which I found to be helpful in debugging joint limits.
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API