{"id":31021435,"url":"https://github.com/sisl/ngsim_env","last_synced_at":"2025-10-24T05:54:34.704Z","repository":{"id":47730766,"uuid":"123202163","full_name":"sisl/ngsim_env","owner":"sisl","description":"Learning human driver models from NGSIM data with imitation learning.","archived":false,"fork":false,"pushed_at":"2020-02-10T20:55:03.000Z","size":59182,"stargazers_count":182,"open_issues_count":20,"forks_count":79,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-09-13T12:27:34.198Z","etag":null,"topics":["autonomous-vehicles","deeplearning","imitation-learning","reinforcement-learning","rllab"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/1803.01044","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sisl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-27T23:39:07.000Z","updated_at":"2025-09-13T05:18:13.000Z","dependencies_parsed_at":"2022-07-26T01:02:56.634Z","dependency_job_id":null,"html_url":"https://github.com/sisl/ngsim_env","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sisl/ngsim_env","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sisl%2Fngsim_env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sisl%2Fngsim_env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sisl%2Fngsim_env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sisl%2Fngsim_env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sisl","download_url":"https://codeload.github.com/sisl/ngsim_env/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sisl%2Fngsim_env/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280748853,"owners_count":26383954,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autonomous-vehicles","deeplearning","imitation-learning","reinforcement-learning","rllab"],"created_at":"2025-09-13T11:21:35.605Z","updated_at":"2025-10-24T05:54:34.677Z","avatar_url":"https://github.com/sisl.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# NGSIM Env\n- This is a rllab environment for learning human driver models with imitation learning\n\n# Description\n- This repository does not contain a [gail](https://arxiv.org/abs/1606.03476) / [infogail](https://arxiv.org/abs/1703.08840) / hgail implementation\n  - The reason ngsim_env does not contain the GAIL algorithm implementation is to enable the codebase to be more modular. This design decision enables ngsim_env to be used as an environment in which any imitation learning algorithm can be tested. Similarly, this design decision enables the GAIL algorithm to be a separate module that can be tested in any environment be that ngsim_env or otherwise. The installation process below gets the GAIL implementation from [sisl/hgail](https://github.com/sisl/hgail)\n- It also does not contain the human driver data you need for the environment to work. The installation process below gets the data from [sisl/NGSIM.jl](https://github.com/sisl/NGSIM.jl).\n- Figure below shows a diagram of the repositories ngsim_env depends on:\n![dependecies](docs/ngsim_env:RepositoryDependencies.png)\n\n# Installation Process\nStep-by-step install instructions are at [`docs/install_env_gail_full.md`](docs/install_env_gail_full.md)\n\n# Train and run a single agent GAIL policy: \n0. Navigate to ngsim_env/scripts/imitation\n1. Train a policy, this involves running imitate.py \n```bash\npython imitate.py --exp_name NGSIM-gail --n_itr 1000 --policy_recurrent True\n```\n2. Run the trained policy by using it to drive a car (this creates trajectories on all NGSIM sections using the trained policy). The training step was called imitate. This step is called validate.\n```bash\npython validate.py --n_proc 5 --exp_dir ../../data/experiments/NGSIM-gail/ --params_filename itr_1000.npz --random_seed 42\n```\n3. Visualize the results: Open up a jupyter notebook and use the visualize*.ipynb files.\n  - the visualize family of ipynb's have headers at the top of each file describing what it does.\n    - visualize.ipynb is for extracting the Root Mean Square Error\n    - visualize_trajectories.ipynb creates videos such as the one shown below in the demo section\n    - visualize_emergent.ipynb calculates the emergent metrics such as offroad duration and collision rate\n\n## Training process: details\n- see [`docs/training.md`](docs/training.md)\n\n## How this works?\n- See README files individual directories for details, but a high-level description is:\n- The python code uses [pyjulia](https://github.com/JuliaPy/pyjulia) to instantiate a Julia interpreter, see the `python` directory for details\n- The driving environment is then built in Julia, see the `julia` directory for details\n- Each time the environment is stepped forward, execution passes from python to julia, updating the environment\n\n## Demo\n### To reproduce our experiments for the multiagent gail paper submitted to IROS, see \n[`scripts/imitation/README.md`](scripts/imitation/README.md)\n\n### GAIL in a single-agent environment\n![](media/single_agent_gail.gif)\n\n### Single agent GAIL (top) and PS-GAIL (bottom) in a multi-agent environment\n![](media/single_multi_model_2_seed_1.gif)\n\n## References\n---\nIf you found this library useful in your research, please consider citing our [paper](https://arxiv.org/abs/1803.01044) and/or \n[paper](https://arxiv.org/abs/1903.05766):\n```\n@inproceedings{bhattacharyya2018multi,\n  title={Multi-agent imitation learning for driving simulation},\n  author={Bhattacharyya, Raunak P and Phillips, Derek J and Wulfe, Blake and Morton, Jeremy and Kuefler, Alex and Kochenderfer, Mykel J},\n  booktitle={2018 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},\n  pages={1534--1539},\n  year={2018},\n  organization={IEEE}\n}\n\n@article{bhattacharyya2019simulating,\n  title={Simulating Emergent Properties of Human Driving Behavior Using Multi-Agent Reward Augmented Imitation Learning},\n  author={Bhattacharyya, Raunak P and Phillips, Derek J and Liu, Changliu and Gupta, Jayesh K and Driggs-Campbell, Katherine and Kochenderfer, Mykel J},\n  journal={arXiv preprint arXiv:1903.05766},\n  year={2019}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsisl%2Fngsim_env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsisl%2Fngsim_env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsisl%2Fngsim_env/lists"}