Skip to content

Conversation

ShindeShivam
Copy link
Contributor

@ShindeShivam ShindeShivam commented Jul 19, 2025

Chapter 11
Cell: Exercise [130]

Fix :

This small fix ensures that the MC Dropout model uses the same trained weights as the original model by adding:

mc_model.set_weights(model.get_weights())

Without this, the MC model uses random weights, leading to incorrect predictions and low accuracy.
Now the example works as intended, with dropout active during inference.

Also, I’ve opened PRs recently that are still pending review — just wanted to kindly mention in case they were missed.🙂

#196
#202
#205
#206

Thanks again for the fantastic book!

— Shivam

@ShindeShivam ShindeShivam changed the title Bugfix/ch11 mc dropout correctness Fix: Copy trained weights to MC Dropout model for correct inference Jul 19, 2025
@ageron
Copy link
Owner

ageron commented Aug 10, 2025

Thanks for your PR!

I don't think adding this line makes any difference since we're already reusing the exact same layers, including their weights.

@ageron ageron closed this Aug 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants