Homework 3
- Modify
train_logistic_regressionfrom Notebook 0221 as follows: If there is a single ensemble dimension, that is the length of the ensemble shape is 1 (this was the case in the settingensemble_shape = (10,)in the notebook), then perform the following steps:- From the validation logits, get the validation probabilities. You can use the
softmaxmethod for this. - Take the average of the validation probabilities along the ensemble dimension.
- Calculate the validation accuracy with these averaged probabilities as logits. (Recall that the argmax of logits and probabilities is the same.)
- Append the value you get to a list in the output dictionary at key
"ensemble validation accuracy".
- From the validation logits, get the validation probabilities. You can use the
- With the updated training loop, train an ensemble of logistic regression models on the MNIST dataset.
- Plot the validation accuracies with a confidence band of level 99%.
- Also make a line plot of the ensemble validation accuracies.
- Show and close the canvas. If done correctly, you can see that the ensemble validation accuracies are consistently above the entire confidence band.