Distribution
DiscretePriorDistribution
Bases: PriorDistribution
An abstract base class representing a discrete prior distribution.
Source code in bionemo/moco/distributions/prior/distribution.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
__init__(num_classes, prior_dist)
Initializes a DiscretePriorDistribution instance.
Args: num_classes (int): The number of classes in the discrete distribution. prior_dist (Tensor): The prior distribution over the classes.
Returns: None
Source code in bionemo/moco/distributions/prior/distribution.py
45 46 47 48 49 50 51 52 53 54 55 56 |
|
get_num_classes()
Getter for num_classes.
Source code in bionemo/moco/distributions/prior/distribution.py
58 59 60 |
|
get_prior_dist()
Getter for prior_dist.
Source code in bionemo/moco/distributions/prior/distribution.py
62 63 64 |
|
PriorDistribution
Bases: ABC
An abstract base class representing a prior distribution.
Source code in bionemo/moco/distributions/prior/distribution.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
sample(shape, mask=None, device='cpu')
abstractmethod
Generates a specified number of samples from the time distribution.
Args: shape (Tuple): The shape of the samples to generate. mask (Optional[Tensor], optional): A tensor indicating which samples should be masked. Defaults to None. device (str, optional): The device on which to generate the samples. Defaults to "cpu".
Returns:
Name | Type | Description |
---|---|---|
Float |
Tensor
|
A tensor of samples. |
Source code in bionemo/moco/distributions/prior/distribution.py
27 28 29 30 31 32 33 34 35 36 37 38 39 |
|