Code for the Neurips'22 paper called "Extrapolation and Spectral Bias of Neural Nets with Hadamard Product: a Polynomial Net Study".
The repo includes the source code for various experiments in the paper.
To run the code, please create a conda environment and install the following packages
conda create -n extra python=3.7.7
conda activate extra
conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
pip install pyyaml
pip install scipy==1.1.0
pip install matplotlib
pip install seaborn
The folder is organized as follows:
extra/
: contains the code for the experiment on extrapolation
spectral
: contains the code for the experiment on spectral bias
vaec
: contains the code for the experiment on vaec dataset
cd extra
sh script_extra.sh
Firstly, download the dataset base on the instruction in the original repo. Then run the followng command to generate data:
cd extra/dset_gen
sh generated_data.sh
Training:
cd script
sh context_norm_scale_extrap.sh
To train the network on MNIST dataset: run
cd spectral
sh script_spectral.sh
Next, to visualzie the result, run
python eval.py
https://github.com/jinglingli/nn-extrapolate https://github.com/taylorwwebb/learning_representations_that_support_extrapolation https://github.com/grigorisg9gr/polynomial_nets_for_conditional_generation/tree/master/conditional_generation_with_gan
If you use this code, please cite
@inproceedings{
wu2022extrapolation,
title={Extrapolation and Spectral Bias of Neural Nets with Hadamard Product: a Polynomial Net Study},
author={Yongtao Wu and Zhenyu Zhu and Fanghui Liu and Grigorios G Chrysos and Volkan Cevher},
booktitle={Advances in Neural Information Processing Systems},
year={2022},
}