scyan.module.PriorDistribution
Bases: LightningModule
Prior distribution \(U\)
Source code in scyan/module/distribution.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
|
prior_h: distributions.Distribution
property
The distribution of \(H\)
__init__(rho, is_continuum_marker, prior_std, n_markers)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rho |
Tensor
|
Tensor $ ho$ representing the knowledge table (size \(P\) x \(M\)) |
required |
is_continuum_marker |
Tensor
|
tensor of size \(M\) whose values tell if the marker is a continuum of expressions. |
required |
prior_std |
float
|
Standard deviation \(\sigma\) for \(H\). |
required |
n_markers |
int
|
Number of markers in the table. |
required |
Source code in scyan/module/distribution.py
difference_to_modes(u)
Difference between the latent variable \(U\) and all the modes (one mode per population).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u |
Tensor
|
Latent variables tensor of size \((B, M)\). |
required |
Returns:
Type | Description |
---|---|
Tensor
|
Tensor of size \((B, P, M)\) representing differences to all modes. |
Source code in scyan/module/distribution.py
log_prob(u)
Log probability per population.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u |
Tensor
|
Latent variables tensor of size \((B, M)\). |
required |
Returns:
Type | Description |
---|---|
Tensor
|
Log probabilities tensor of size \((B, P)\). |
Source code in scyan/module/distribution.py
log_prob_per_marker(u)
Log probability per marker and per population.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u |
Tensor
|
Latent variables tensor of size \((B, M)\). |
required |
Returns:
Type | Description |
---|---|
Tensor
|
Log probabilities tensor of size \((B, P, M)\). |
Source code in scyan/module/distribution.py
sample(z)
Sampling latent cell-marker expressions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
z |
Tensor
|
Tensor of population indices. |
required |
Returns:
Type | Description |
---|---|
Tensor
|
Latent expressions, i.e. a tensor of size \((len(Z), M)\). |