Title: Being Friends Instead of Adversaries: Deep Networks Learn to Simplify Data to Train Other Networks Authors: Simone Marullo, Matteo Tiezzi, Marco Gori, Stefano Melacci
Notice that reproducibility is not guaranteed by PyTorch across different releases, platforms, hardware. Moreover, determinism cannot be enforced due to use of PyTorch operations for which deterministic implementations do not exist (e.g. bilinear upsampling).
Make sure to have Python dependencies (including PyTorch) by running:
pip install -r requirements.txt
CIFAR-10 is publicly available (automatic download in data
directory).
MNIST Variations and geometric shapes [2] are available at http://www.iro.umontreal.ca/~lisa/icml2007data (downloader script in download_larochelle.sh
).
Wines reviews are available on Kaggle. The original data are included in data
directory. Text vectorization should be performed by running the Python script data/wines_data_processing.py
.
IMDB reviews are available at stanford.edu. Downloader script is available (see download_imdb.sh
). Text vectorization should be performed by running the Python script data/imdb_data_processing.py
.
Neural Friendly Training experiments can be launched with the train-neural.py
Python script.
On the other hand, experiments with the FT approach (see Supplementary material and [1] for details) can be run with train-delta.py
.
Example commands are available in the scripts
directory (run them from the root directory). See commands_advanced-digit-and-shape-recognition.sh
, commands_image-classification.sh
, commands_sentiment-analysis.sh
to repreduce results reported in the tables of the paper.
Algorithm 1 of paper text (NFT) is implemented in train-neural.py
(optimization phases are swapped but equivalent).
Names of command line parameters slightly differ with respect to paper text, hence we report the name mapping (more details in the code).
Parameter ratio_simp
, epochs
.
Concerning the U-Net simplifier, n_deep
, n_filters_base
.
lr_clf
, lr_simp
. beta_simp
.
We implemented FT algorithm (see [1]) in train-delta.py
.
ratio_simp
, while conf_thres
.
lr
, step_simp
.
Architectures FC-A, FC-B, CNN-A, CNN-B, ResNet18 are named ff
, ff2
, cnn
, cnn2
, resnet
.
[1] Marullo, S.; Tiezzi, M.; Gori, M.; and Melacci, S. 2021. Friendly Training: Neural Networks Can Adapt Data To Make Learning Easier. In IEEE International Joint Conference on Neural Networks (IJCNN) (arXiv preprint arXiv:2106.10974).
[2] Larochelle, H.; Erhan, D.; Courville, A.; Bergstra, J.; and Bengio, Y. 2007. An empirical evaluation of deep architectures on problems with many factors of variation. In International Conference on Machine Learning, 473–480.
This software was developed in the context of some of the activities of the PRIN 2017 project RexLearn, funded by the Italian Ministry of Education, University and Research (grant no. 2017TWNMH2).