# Deep Neural Collapse Is Provably Optimal for the Deep Unconstrained Features Model
## Code instructions

The crucial classes for our experiments are "TrainerAndAnalyzer" and "RealNNTrainerAndAnalyzer" classes in the 
training.py file. The first class can run the pure DUFM training experiments. To run such experiment, simply initialize 
an object from the corresponding class with suitable arguments and then call the "run_and_analyze" method with suitable 
arguments. The second class can run experiments on real datasets with real DNN as a backbone. 

The DUFM model is implemented in models.py file as the "GeneralMLP" class. The "FeatureRefiner" class in nn_models.py 
file is of similar nature, though assumed to be attached to a real DNN. 

The ResNet backbone is also implemented in the nn_models.py file. It provides the user with the option to choose from 
different depths. Furthermore, the classes "ExtendedResNet" refer to models that combine the ResNet backbone with the 
DUFM head. The CIFAR10 and MNIST datasets, together with a function to order samples is implemented in dsets.py file. 

Finally, run_resnet_cifar.py is a template file to be run for practical training on real dataset. It also includes more 
details on some important training parameters. 
