torch_blue.vi.VIkwargs
- class torch_blue.vi.VIkwargs
Bases:
TypedDictCommon keyword arguments for most VIModules.
Most
VIModuleaccept these as keyword arguments. Unless specified otherwise, they use the defaults below.This class is only used for documentation and type hinting.
- Parameters:
variational_distribution (Union[Distribution, List[Distribution]], default:
MeanFieldNormal()) – Either onetorch_blue.vi.distributions.Distribution, which is used for all random variables, or a list of them, one for each random variable. This specifies the assumed parametrization of the weight distribution.prior (Union[Distribution, List[Distribution]], default:
MeanFieldNormal()) – Either oneDistribution, which is used for all random variables, or a list of them, one for each random variable. This specifies the previous knowledge about the weight distribution.rescale_prior (bool, default: False) – If
True, the priors_scaling_parametersare scaled with the sqrt of the layer width. This may be necessary to maintain normalization for wide layers.prior_initialization (bool, default: False) – If
Trueparameters are initialized according to the prior. IfFalseparameters are initialized similar to non-Bayesian networks.return_log_probs (bool, default: True) – If
Truethe model forward pass returns the log probability of the sampled weights. This is required for use ofKullbackLeiblerLoss.device (Optional[torch.device], default: None) – The torch.device on which the module should be stored.
dtype (Optional[torch.dtype], default: None) – The torch.dtype of the module parameters.