Learning to Gather Information via Imitation
S. Choudhury, A. Kapoor, G. Ranade, D. Dey. "Learning to Gather Information via Imitation". In ICRA, 2017.
S. Choudhury, A. Kapoor, G. Ranade, S.Scherer, D. Dey. "Adaptive Information Gathering via Imitation Learning". In RSS, 2017.
For C++ codebase, check
Create a folder to contain all repositories and cd into it.
mkdir matlab_learning_info_gain_ws cd matlab_learning_info_gain_ws
Clone this repository
git clone https://bitbucket.org/sanjiban/matlab_learning_info_gain.git
Clone a dependency repository used for the backend of exploration simulation
git clone https://bitbucket.org/castacks/matlab_safe_navigation.git
Clone the datasets repository
git clone https://bitbucket.org/sanjiban/matlab_learning_info_gain_dataset.git
Once you have the datasets, add the path to the datasets folder to the environment variable dataset_folder in init_setup.m
Setup required on starting MATLAB
- Start Matlab
- Go to the folder matlab_learning_info_gain
- Everytime you startup MATLAB, you have to run the script init_setup.m
This ensures that all the relative paths are set.
Running the Code
We now describe a quick start to running the code. There are 3 kinds of operations that you can do - visualize a policy on a datapoint, test a policy on a dataset or train a policy on the dataset. If you want to create a dataset from scratch, look at the next section. We recommend you start of by visualizing a policy.
1. Visualizing a policy on a datapoint
To visualize a policy on a datapoint, go to main/visualize_policy.m
The script is self explanatory. The dataset already has pretrained policies that were used in the papers, so you can visualize them without training code.
2. Testing a policy on a dataset
To test a policy on a dataset, go to main/test_policy.m
The script is self explanatory. The dataset already has pretrained policies that were used in the papers, so you can test them and reproduce numbers in the paper
3. Training a policy on a dataset
To train a policy, go to main/test_online_policy.m
The script is self explanatory. The script terminates by saving the interim models at all iterations and the results in the local folder. To test the policy you just trained, you have to copy the models in the appropriate folder with the appropriate name. Refer to the pre-trained policies for these naming conventions. Note: Training a policy to convergence will take several hours on a Macbook Pro with 4 parallel pool.
Creating a Dataset from Scratch
If you want to create your own dataset, train a model and test it against baselines, follow these steps.
Creating the raw images
- Create a folder in matlab_learning_info_gain_dataset (we call it dataset_5 for example)
- cd dataset5
- mkdir data images learnt_predictors precomputed_expert
- cd images
- create train images and call them map_1.png map_2.png ...
- create test images and call it map_test.png
Doing data processing
- Go to the source code matlab_learning_info_gain
- cd dataset_processing
- Run the script create_data_from_images.m This creates a train and test dataset in dataset_5/data
- Run the script precompute_expert_on_data.m This creates a roll out on the test dataset using the expert that will be used in aggrevate
Training the policy
Follow the same instructions to train a policy, save it in learnt_predictors and then test it
Who do I talk to?
- Sanjiban Choudhury (firstname.lastname@example.org)