Question: 3 . 2 : Training FCN [ 5 points ] Now, write a training loop and train the FCN model in the cell below. TODO:

3.2: Training FCN [5 points]
Now, write a training loop and train the FCN model in the cell below.
TODO:
Instantiate the Logistic regression to the variable fcn. Make sure to send this to the GPU device!
Set the loss criterion as CrossEntropyLoss (you can look up the documentation here). Note that softmax is already built into CrossEntropyLoss so if you use CrossEntropyLoss as the loss criterion, you don't need to add an additional softmax layer.
Fill in the missing parts in the training loop (see #TODO comments below)
Save the Training Accuracy for every epoch into the variable acc_LIST_FCN.
Save the Average Loss for every epoch into the variable loss_LIST_FCN.
The optimizer is set as Adam -- please do not modify the optimizer.
Note: If the loss went up during the training, there is something wrong with the model, so you should check if the model is implemented correctly
Hint: Think about what your model is outputting when it is run on your data, and what additional steps (if any) you need to perform to get to your final classifications.

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