Part 3 (5 points, coding task)
Do the following tasks:
Let x be a tensor with shape (N,2).
-
What is the number of dimensions of
model(x)? -
What is the shape of
model(x)? -
Explain the reasoning of your answers.
Do the following tasks:
Let x be a tensor with shape (N,2).
What is the number of dimensions of model(x)?
What is the shape of model(x)?
Explain the reasoning of your answers.
\color{green}{\text{### WRITE YOUR SOLUTION HERE ###}}
The dimension of model(x) is 2.
The shape of model(x) is (N,1).
For each sample, the output is a 1-dim tensor with shape (1,). Therefore, by having N samples, we get the answers above.
\color{red}{\text{""" END OF THIS PART """}}
The model takes in 2 input features to produce an output feature, so with a batch of size N, the shape of model(x) will be (N,1), making the number of dimensions 2.