HW2

Due on March 20

  1. An input of size \(100 \times 100\) with 50 channels passes through each of the following modules (not consecutively). Compute the output size after each module and the number of parameters involved.

    1. (4 points) Max pooling of filter size \(4\times 4\) with stride 4

    2. (4 points) A regular conv layer of filter size \(5\times 5\) with 40 channels with stride 3 and no padding

    3. (4 points) A regular conv layer of filter size \(7\times 7\) with 50 channels, stride 1 and same padding

      1. (4 points) Replace the above with depthwise separable convolution instead

      2. (4 points) Replace the above with a block containing a bottleneck layer to reduce the number of parameters. That is, first reduce the number of channels to 10 by \(1\times 1\) conv layer. Then, apply \(7\times 7\) conv layer with 10 output channels. Finally expand it again back to \(50\) channels using \(1\times 1\) conv layer.

  2. (15 points) Try to use PyTorch lightning to build a U-net like predictor for the stock market data. Please construct the structure as shown below. In PyTorch lightning model, it have following functions: init(), forward(), training_step(), validation_step(), configure_optimizers(), train_dataloader() and val_dataloader(). You may want to truncate the training and test input lengths to factors of 4 to avoid complications from downsampling and upsampling.

    1. (5 points) Plot the estimated price along with the ground truth for training, validation, and test data in three separate plots.

alt text