Question: We will intialize model using the MultiLayerNetwork ( ) and train the model with the train ( ) method We will display the training and

We will intialize model using the MultiLayerNetwork() and
train the model with the train() method We will display the training and plot the traing loss
# You should be able to get a train accuracy of >91% and a test accuracy >90% # The settings below gave >92% train accuracy and >91% test accuracy # Feel free to adjust the values and the architecture # Keep the network to 4 layers and num_epochs 500
|
seed =1
torch.manual_seed(seed)
num_epochs =300
learning_rate =0.1
net_dims =[784,200,10]
# 2 layer network
#784 is for image dimensions
#200 is arbitrary hidden layer
#10 is for number of categories
#activation_list 'relu', 'softmax'] #default activation.
## Initialize model
## Display model
## Estimate cost as the output of train(...)
### BEGIN SOLUTION ###
### END SOLUTION ###
yhat = model. forward (trx)
ypred = torch. yhat, axis =0. reshape (1,-1)
trAcc = torch.mean ypred ==trY float ()
 We will intialize model using the MultiLayerNetwork() and train the model

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 Databases Questions!