Code for the paper NeuralEF: Deconstructing Kernels by Deep Neural Networks.
This project is tested under the following environment settings:
- Python 3
- PyTorch: 1.9.0
python neuralef-classic-kernels.py
python neuralef-toy-nngpkernels.py
python neuralef-mnist-cnngpkernels.py
python neuralef-cifar-ntks.py --nef-amp --classes 0 1 --ood-classes 8 9 \
--resume path/to/pretrained
python neuralef-cifar-ntks.py --nef-amp --ntk-std-scale 20
python neuralef-cifar-sgd-trajectory.py --data-dir path/to/data \
--nef-amp --nef-class-cond --swa-lr 0.1 \
--pre-trained-dir path/to/pretrained
If you use this code in your work, we ask that you cite the paper.
The implementation of the baselines is based on SWAG and SpIN.