{"id":21589191,"url":"https://github.com/modanesh/differential_ig","last_synced_at":"2025-04-10T21:53:13.197Z","repository":{"id":37679248,"uuid":"247766120","full_name":"modanesh/Differential_IG","owner":"modanesh","description":"Source code for the differential saliency method used in \"Re-understanding Finite-State Representations of Recurrent Policy Networks\"","archived":false,"fork":false,"pushed_at":"2023-10-04T01:05:33.000Z","size":5353,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T21:53:00.708Z","etag":null,"topics":["computer-vision","explainable-ai","pytorch","reinforcement-learning","saliency"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2006.03745","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/modanesh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-16T16:36:51.000Z","updated_at":"2024-08-19T04:00:57.000Z","dependencies_parsed_at":"2022-09-15T09:02:42.966Z","dependency_job_id":null,"html_url":"https://github.com/modanesh/Differential_IG","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modanesh%2FDifferential_IG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modanesh%2FDifferential_IG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modanesh%2FDifferential_IG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modanesh%2FDifferential_IG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/modanesh","download_url":"https://codeload.github.com/modanesh/Differential_IG/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248305848,"owners_count":21081562,"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","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":["computer-vision","explainable-ai","pytorch","reinforcement-learning","saliency"],"created_at":"2024-11-24T16:13:01.108Z","updated_at":"2025-04-10T21:53:13.178Z","avatar_url":"https://github.com/modanesh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Differential Integrated Gradient\n\nThis is the implementation of the differential saliency method used in \"[Re-understanding Finite-State Representations of Recurrent Policy Networks](https://arxiv.org/abs/2006.03745)\", accepted to the **International Conference on Machine Learning (ICML) 2021**. \n\n## Installation\n* Python 3.5+\n* To install dependencies:\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n## Usage\nYou can use ```main_IG.py``` or ```main_IG_control.py``` for experimenting with Atari and Control Tasks from OpenAI Gym.\n\nTo begin, you  need to load and use models trained here: [MMN](https://github.com/koulanurag/mmn). Once you took all the steps, you end up with a MMN model, and that's what is needed in this repo. Trained models should be put into the ```inputs``` directory with a proper name.\n\nHaving the models, it's time to run the code. To do that, just run the following command to get the results for Atari games:\n```\npython main_IG.py --env_type=atari --input_index=43 --baseline_index=103 --env PongDeterministic-v4 --qbn_sizes 64 100 --gru_size 32\n```\nValues of the input arguments can be changed according to your interest.\n\nAnd the following command to get the results for control tasks:\n```\npython main_IG_control.py --env_type=classic_control --input_index=10 --baseline_index=106 --env CartPole-v1 --qbn_sizes 4 4 --gru_size 32\n```\n\nResults will be saved into the ```results``` folder. In the repo, we have already provided sample results. For example, in the case of CartPole, an output will look like the following:\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./results/classic_control/CartPole-v1/input_10_baseline_100/diff_IGs.jpg\" width=\"200\" height=\"400\" title=\"CartPole-v1 differential integrated gradient result\"\u003e\n\u003c/p\u003e\n\n## Citation\nIf you find it useful in your research, please cite it with:\n```\n@inproceedings{danesh2021re,\n  title={Re-understanding Finite-State Representations of Recurrent Policy Networks},\n  author={Danesh, Mohamad H and Koul, Anurag and Fern, Alan and Khorram, Saeed},\n  booktitle={International Conference on Machine Learning},\n  pages={2388--2397},\n  year={2021},\n  organization={PMLR}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodanesh%2Fdifferential_ig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmodanesh%2Fdifferential_ig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodanesh%2Fdifferential_ig/lists"}