# TransferRobust **Repository Path**: mymashiro/TransferRobust ## Basic Information - **Project Name**: TransferRobust - **Description**: transfer learning with robust - **Primary Language**: Python - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-27 - **Last Updated**: 2021-06-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # CARTL: Cooperative Adversarially-Robust Transfer Learning Code for ICML'21 paper, *CARTL: Cooperative Adversarially-Robust Transfer Learning*. ### Prerequisites - python==3.7 - pytorch==1.5.1 - torchvision==0.6.1 - tensorboard==2.4.0 - tensorboard-plugin-wit==1.7.0 - toml==0.10.2 - matplotlib==3.2.2 - pydantic==1.5.1 - pydantic[dotenv] - pandas==1.2.0 - autoattack==0.1 - foolbox==3.2.1 You can download these packages manually or run `pip install -r requirements.txt` For command-line interface support, run `pip install --editable .` ### License This code is released under the MIT License (refer to the LICENSE file for details). ### Code Overview ``` . ├── exps # Code for experiments ├── scripts # Script for simplifying experiments ├── src │   ├── cli # Code for command-line interface │   ├── networks # Code for neural networks │   ├── trainer # Code for training process │   └── utils # Code for utilities(logging, dataloader etc.) └── tests # Code for testing key components ``` Please run the script `./scripts/init.sh` for creating required directories `checkpoint`, `trained_models`, `misc_results`(containing experimental results), `logs` (containing running logs) and `runs`(containing files for tensorboard). ### Simple Instructions #### Train an adversarial teacher model ```bash cli at -m -n -d ``` Run `cli at --help` for details #### Train a fdm teacher model ```bash python -m exps.fdm_l2 -m -n -d -k -l ``` Or using cli tools(run `cli fdm --help` for details) #### Transfer learning ```bash python -m exps.transfer_learning -m -n -d -k -t ``` Or using cli tools(run `cli tl --help` for details) #### Transfer learning with NEFT Change parameters in `./script/pwrn34_neft_sn_norm.sh` and run ``` ./script/pwrn34_neft_sn_norm.sh ``` Or using cli tools(run `cli sntl --help` for details) #### Lwf ```bash cli lwf -m -n -d -l -t ``` #### Explore experiment Here is a quick example on how to explore our experiment ```bash ./script/exploration_exp.sh [GPU_ID] ``` If you wish to explore more results, just modify the parameters in `./script/exploration_exp.sh` ### Reference ``` @inproceedings{chen2021cartl, author = {Chen, Dian and Hu, Hongxin and Wang, Qian and Li, Yinli and Wang, Cong and Shen, Chao and Li, Qi}, title = {CARTL: Cooperative Adversarially-Robust Transfer Learning}, BOOKTITLE = {International Conference on Machine Learning}, YEAR = {2021} } ```