Skip to content

Variance Network Distributions

VarBayesModuleNetDistribution

Bases: BaseNetDistribution

Class for distribution of variance nets. This class sees nets as elements of distribution. It helps sample nets from this distribution or estimate statistics of distribution. For this purpose it have base module architecture and distribution of parameters for each of it weights.

Source code in src/methods/bayes/variational/net_distribution.py
class VarBayesModuleNetDistribution(BaseNetDistribution):
    """
    Class for distribution of variance nets. This class sees nets as elements of distribution.
    It helps sample nets from this distribution or estimate statistics of distribution.
    For this purpose it have base module architecture and distribution of parameters for
    each of it weights.
    """
    def __init__(self, base_module: nn.Module, weight_distribution: dict[str, ParamDist]) -> None:
        """_summary_

        Args:
            base_module (nn.Module): custom module layer which is going to be converted to BayesModule
            weight_distribution (dict[str, ParamDist]): posteror distribution for each parameter of moudule
        """
        super().__init__(base_module=base_module, weight_distribution=weight_distribution)

__init__(base_module, weight_distribution)

summary

Parameters:

Name Type Description Default
base_module Module

custom module layer which is going to be converted to BayesModule

required
weight_distribution dict[str, ParamDist]

posteror distribution for each parameter of moudule

required
Source code in src/methods/bayes/variational/net_distribution.py
def __init__(self, base_module: nn.Module, weight_distribution: dict[str, ParamDist]) -> None:
    """_summary_

    Args:
        base_module (nn.Module): custom module layer which is going to be converted to BayesModule
        weight_distribution (dict[str, ParamDist]): posteror distribution for each parameter of moudule
    """
    super().__init__(base_module=base_module, weight_distribution=weight_distribution)