Provide the model type--config-name
to train and test models
configured as those shown in the paper.
- This repository depends on a few submodules. To clone either use
git clone --recurse-submodules
or usegit submodule update --init --recursive
after cloning. - Install the requirements using conda by running
conda env create -f environment.yaml
Scripts assume the project root is the current directory.
Example commands:
python sl_pipeline.py --config-name classical +dataset=MNIST
Tensorboards are saved to run_data/tensorboards
and can be viewed by
running:
tensorboard --logdir ./run_data/tensorboards --reload_multifile True
Only the model with the best validation error is saved. To quickly verify the the test error of this model, run the adversarial robustness script. It prints the nominal test error before performing the attack.
Assuming the current directory is robustness
. Notice that the model file
name will be different depending on the dataset and model combination you
have run. The path provided should provide an idea of the directory structure
where models are stored.
These scripts will print the testing error, followed by the testing error with and adversarial attack. Notice adversarial testing requires significantly more resources.
PYTHONPATH=../ python untargeted_robustness.py --config-name classical norm="2" \
+dataset=MNIST \
"+model_file='../run_data/tensorboards/d.MNIST_m.ClassicalModule(RESNET18)_b.128_lr.0.01_wd.0.0001_mepoch120._sd0/default/version_0/checkpoints/epoch=7-step=3375.ckpt'"
PYTHONPATH=../ python untargeted_robustness.py --config-name classical \
norm="inf" +dataset=MNIST \
"+model_file='../run_data/tensorboards/d.MNIST_m.ClassicalModule(RESNET18)_b.128_lr.0.01_wd.0.0001_mepoch120._sd0/default/version_0/checkpoints/epoch=7-step=3375.ckpt'"
MNIST
FashionMNIST
CIFAR10
CIFAR100
anode
: Data-controlled dynamics with ResNet18 Component trained through solution differentiationclassical
: ResNet18lyapunov
: Data-controlled dynamics with ResNet18 Component trained with LyaNetcontinuous_net
: ContinuousNet from [1] trained through solution differentiationcontinuous_net_lyapunov
: ContinuousNet from [1] trained with LyaNet