Problem 11
Use PyTorch to build a multi-layer perceptron model that does the following inference.
On a 2-dim plane, consider a triangle enclosed by (0, 0), (1, 0), and (0, 2).
For your model, each input sample is a data point on a 2-dim plane. The output value is 1 if this data point is an interior point of this triangle and 0 if it is not.
Your model architecture and parameter values shall be ready for doing this inference. That is, there is no training in this problem. While doing inference, the input is a tensor with shape (B, 2), where B is a batch size.
Since this problem does not require you to do training, please feel free to use the following threshold function as your activation function:
\Theta (x) = \begin{cases} 1 & \text{if } x \geq 0 \\ 0 & \text{if } x < 0 \end{cases}