Question: Here is a LetNet model: In [18]: # Model hyperparameters to consider, we just tune output_channel in this homework lrs=[0.9,1.5] hidden_1=80 hidden_2 2=84 output_channel_1s=[4,6] output_channel_2s=[12,16]
Here is a LetNet model:
![Here is a LetNet model: In [18]: \# Model hyperparameters to consider,](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4df0c52e78_91566f4df0bcf853.jpg)
![we just tune output_channel in this homework lrs=[0.9,1.5] hidden_1=80 hidden_2 2=84 output_channel_1s=[4,6]](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4df0d0658c_91666f4df0c88bf4.jpg)
![output_channel_2s=[12,16] \# Loss function loss_function =nn. CrossEntropyLoss() Question 2: Train the LeNet](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4df0d98037_91766f4df0d3ba36.jpg)
In [18]: \# Model hyperparameters to consider, we just tune output_channel in this homework lrs=[0.9,1.5] hidden_1=80 hidden_2 2=84 output_channel_1s=[4,6] output_channel_2s=[12,16] \# Loss function loss_function =nn. CrossEntropyLoss() Question 2: Train the LeNet CNN model (50 pts) II In this question, you will write a few lines to train the LeNet you just build. This is similar to Homework 1. Here's the list of things that you need to implement. All of them can (should) be done using one line of code. Initialize the model with a set of hyperparameters Initialize the optimizer with the model's trainable parameters Set the model into the training mode For every batch of data: zero the gradient in the optimizer feed the input into the model compute the loss back propagate the loss update the optimizer Your model should obtain a test set accuracy of at least 0.85 in order to secure full points. A training procedure that is correct but yields an accuracy lower than 0.85 will receive 25 points. ]: random_seed =3407 torch.manual_seed(random_seed) torch.backends. cudnn. deterministic = True torch.backends. cudnn.benchmark = False
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
