Question: EX4: Write a computer code that can learn the XOR (eXclusive OR) boolean logic operator by means of linearonlinear regression. First show that a linear

EX4: Write a computer code that can learn the XOR (eXclusive OR) boolean logic operator by means of linearonlinear regression. First show that a linear model fails to learn such a mapping, then implement a 2 layers NN and verify its ability to overcome the limitations of the linear model. (HINT: for the linear model, the weights can be estimated by both directly creating and inverting the linear regression matrix or by means of gradient descent; for the nonlinear model, use Pytorch to build and optimize the network)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
