1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate Deep Learning with PyTorch

Connected

Exercise

Two-output model architecture

In this exercise, you will construct a multi-output neural network architecture capable of predicting the character and the alphabet.

Recall the general structure: in the .__init__() method, you define layers to be used in the forward pass later. In the forward() method, you will first pass the input image through a couple of layers to obtain its embedding, which in turn is fed into two separate classifier layers, one for each output.

torch.nn is already imported under its usual alias, so let's build a model!

Instructions 1/2

undefined XP
    1
    2
  • Define self.classifier_alpha and self.classifier_char as linear layers with input shapes matching the output of image_layer, and output shapes corresponding to the number of alphabets (30) and the number of characters (964), respectively.