yamle.methods.be module#
- yamle.methods.be.replace_with_be(model, num_members)[source]#
- This method is used to replace all the nn.Linear, nn.Conv2d layers
with a LinearBE, Conv2dBE respectively.
- class yamle.methods.be.BEMethod(*args, **kwargs)[source]#
Bases:
MemberMethodThis class is the extension of the base method for BatchEnsemble models.
The difference is in having to change the prediction to concatenate the num_members dimension. into the batch dimension during validation and testing.
Note that only Linear and Conv2d layers are supported, not the batch norm layers. In practice this is not a problem google/edward2