Deep Neural Networks, Homework 1
Recognizing and counting shapes.
Running experiments
python src/run.py configuration.yaml
Configuration
We can specify various training scenarios via YAML files. This allows us to experiment with different network architectures and hyperparameters.
The configuration should have the following fields:
type: one ofclassification,counting-small,counting-large, depending on which problem we're attempting to train for. This controls:- the size of the final output layer
- final transformation applied to output layer
- transformations applied to targets, if necessary
- the loss function used
- the accuracy metric used
batch_norm(defaults tofalse)dropout(defaults tofalse):falseorpparameter for dropout layerslrepochsbatch_sizeaugmentations: list of augmentation specifications to expand the dataset with:rotation(defaults to 0): integer 0-3 specifying number of 90° rotations to applyvflip(defaults tofalse)hflip(defaults tofalse)
convolutions: a list of convolution layer specifications:in_channelsout_channelssize(defaults to 3)stride(defaults to 1)padding(defaults to 1)max_pool(defaults tofalse): whether to apply a 2x2 max pool layer
linears: a list of desnse layer specifications:in_featuresout_features
Results
For each run, a timestamped directory is created under outputs/ with:
- A copy of the used configuration file
- A CSV file with train set losses, test set losses, and test set accuracies, for each epoch
losses.png: a plot of the lossesaccuracies.png: a plot of the accuraciesnet.pt: weights of the trained model