Fix KL computation #2
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
I think there might be a few problems in your model definitions.
In particular:
resnet_flipout.py
andresnet_variational.py
you only sum thekl
of the lastblock
insideself.layerN
resnet_flipout_large.py
andresnet_variational_large.py
you check foris None
while you probably wantis not None
or actually no check at all since it can't beNone
in any reasonable setting. Also thestr(layer)
check is odd since it contains aBasicBlock
orBottleNeck
object (you're looping over annn.Sequential
ofblock
s). In fact in this code that string check is very likely superfluous (didn't test this, but I did include it in this PR as example)I hope you can confirm and perhaps fix these issues, which will help me (and maybe others) in building on your nice codebase :)