Skip to content
Multi-Task Hierarchical Imitation Learning of Robot Skills
Branch: master
Clone or download
Pull request Compare This branch is 2 commits ahead of BerkeleyAutomation:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Multi-Task Hierarchical Imitation Learning for Home Automation

This is code for the paper Multi-Task Hierarchical Imitation Learning for Home Automation, Roy Fox*, Ron Berenstein*, Ion Stoica, and Ken Goldberg, CASE 2019. It enables running the HIL-MT server, generating annotated demonstrations, learning hierarchical controllers, and rolloing learned controllers on an HSR robot.


In addition to the dependencies in requirements.txt, the HSREnv depends on pyyolo. Please follow these instructions to install pyyolo, and then change the paths in to your installation path.

Running HIL-MT

To run the HIL-MT server:

python hilmt/

To run the server in debug mode, set the DEBUG flag to True in

Providing demonstrations

To rollout a demonstration of the SetTable task:

python --domain dishes --task SetTable --data data --teacher

Available tasks are: ClearTable and SetTable in the dishes domain; and Pyramid<n> (pyramid of height n) in the pyramid domain. Annotated demonstrations will be saved in the path provided to --data.

To implement new domains, inherit from Env (or its subclass HSREnv) -- see PyramidEnv for example. To implement new tasks, inherit from Agent (or its subclass HierarchicalAgent) -- see PyramidAgent for example.

Human teleoperation is performed by actions starting with Record_, which pause the script to allow human control and record it. Before training, the recorded demonstrations must be fixed to format the recorded control as robot control. To fix all demonstrations in a path:

python -c "import fix; fix.fix_record('data/dishes/SetTable_fix', 'data/dishes/SetTable_rec')"

Training hierarchical controller

To train controllers for the ClearTable and SetTable tasks:

python --domain dishes --tasks ClearTable SetTable --data data

All controllers but the last will be trained independently from all their available data. The last controller (SetTable in this case) will be trained with detailed mode selection with the data of past tasks and with new demonstrations added one by one. The results of training will be saved in results/dishes/ClearTable.SetTable.

Use --runs <n> to repeat training for n independent trials. Use --independent to train the last controller only independently of the other tasks. Use --full-batch to train the last controller from all available data, rather than stopping when enough demonstrations were given to successfully train and validate the controller.

Evaluating a trained controller

To rollout a trained controller:

python --domain dishes --task SetTable --model model --data eval

Data from the evaluation experiment will be saved in the path provided to --data.

You can’t perform that action at this time.