Code for reproducing our results in the GradMax paper [arxiv.org/abs/2201.05125].
First clone this repo.
git clone https://github.com/google-research/growneuron.git
cd growneuronFollowing script installs the necessary libraries and runs few tests.
bash run.shFollowing will download the data and run the baseline experiment. If the
data is already downloaded use the --data_dir flag to pass the path.
python growneuron/cifar/main.py --output_dir=/tmp/cifar --download_dataFollowing command would start a training with WRN-28-0.25x and grow it into WRN-28-1. Growth is done every 2500 step starting from iteration 10000 at all convolutional layers at once.
rm -rf /tmp/cifar
python growneuron/cifar/main.py --output_dir=/tmp/cifar \
--config=growneuron/cifar/configs/grow_all_at_once.py \
--config.grow_type=add_gradmax- Baselines for WRN-28 and VGG11 can be ran using the corresponding configs in
growneuron/cifar/configs/. - Set
--config.grow_typeargument toadd_gradmax,add_firefly,add_gradmax_optoradd_randomto grow using different strategies. - Use
--config.is_outgoing_zeroto run experiments where outgoing weights are set to zero. - Use
--config.model.normalization_type=batchnormto run experiments with batch normalization layers.
This is not an officially supported Google product.
