Question: Consider a multilayer perceptron ( MLP ) with two inputs and one output, f : R 2 - > R , that seeks to approximate

Consider a multilayer perceptron (MLP) with two inputs and one output, f : R2-> R, that seeks to approximate multiplication of two real numbers, i.e. f (x, y) x y.
(a) Using only linear (fully connected) and ReLU layers, implement an MLP for
this task in PyTorch.
(b) Create an appropriate training loop to train the network on random data using a loss function of your choice. You should explicitly comment on what assumptions you are making about the range of the training data.
(c) Evaluate the network in terms of the absolute error in its prediction,
i.e.| f (x, y)(x y)|. You should report a mean error over random samples within the range of the training data but also a generalisation error when tested on inputs outside the range of the training data.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!