Homework 6
Aggregazione dei criteri
Aperto: lunedì, 19 aprile 2021, 00:00
Data limite: martedì, 4 maggio 2021, 00:00
Taking inspiration from the last 2 pictures within the notebook (07-convnets.ipynb), implement a U-Net-style CNN with the following specs:
- All convolutions must use a 3 x 3 kernel and leave the spatial dimensions (i.e. height, width) of the input untouched.
- Downsampling in the contracting part is performed via maxpooling with a 2 x 2 kernel and stride of 2.
- Upsampling is operated by a deconvolution with a 2 x 2 kernel and stride of 2. The PyTorch module that implements the deconvolution is `nn.ConvTranspose2d`
- The final layer of the expanding part has only 1 channel
- between how many classes are we discriminating?
Create a network class with (at least) a `__init__` and a `forward` method. Please resort to additional structures (e.g., `nn.Module`s, private methods...) if you believe it helps readability of your code.
Test, at least with random data, that the network is doing the correct tensor operations and that the output has the correct shape (e.g., use `assert`s in your code to see if the byproduct is of the expected shape).
Note: the overall organization of your work can greatly improve readability and understanding of your code by others. Please consider preparing your notebook in an organized fashion so that we can better understand (and correct) your implementation.
Given the difficulty of this homework, the tentative due date has been fixed to Monday May 3rd at midnight. Please contact us in case you needed help.