blob: a4fd6cfd9cb1492931a2a33bdd74543cbb966e22 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# 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 of `classification`, `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 to `false`)
* `dropout` (defaults to `false`): `false` or `p` parameter for dropout layers
* `lr`
* `epochs`
* `batch_size`
* `augmentations`: list of augmentation specifications to expand the dataset
with:
* `rotation` (defaults to 0): integer 0-3 specifying number of 90° rotations
to apply
* `vflip` (defaults to `false`)
* `hflip` (defaults to `false`)
* `convolutions`: a list of convolution layer specifications:
* `in_channels`
* `out_channels`
* `size` (defaults to 3)
* `stride` (defaults to 1)
* `padding` (defaults to 1)
* `max_pool` (defaults to `false`): whether to apply a 2x2 max pool layer
* `linears`: a list of desnse layer specifications:
* `in_features`
* `out_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 losses
* `accuracies.png`: a plot of the accuracies
|