Logit normal
LogitNormalTimeDistribution
基类:TimeDistribution
表示 Logit normal 时间分布的类。
源代码在 bionemo/moco/distributions/time/logit_normal.py
中
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 |
|
__init__(p1=0.0, p2=1.0, min_t=0.0, max_t=1.0, discrete_time=False, nsteps=None, rng_generator=None)
初始化 BetaTimeDistribution 对象。
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
p1
|
浮点数
|
logit normal 分布的第一个形状参数,即均值。 |
0.0
|
p2
|
浮点数
|
logit normal 分布的第二个形状参数,即标准差。 |
1.0
|
min_t
|
浮点数
|
最小时间值。 |
0.0
|
max_t
|
浮点数
|
最大时间值。 |
1.0
|
discrete_time
|
布尔值
|
时间是否离散。 |
False
|
nsteps
|
Optional[int]
|
离散化的 nsteps 数量。 |
None
|
rng_generator
|
Optional[Generator]
|
用于可重现采样的可选 :class: |
None
|
源代码在 bionemo/moco/distributions/time/logit_normal.py
中
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
sample(n_samples, device='cpu', rng_generator=None)
从均匀时间分布生成指定数量的样本。
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
n_samples
|
整数
|
要生成的样本数。 |
必需 |
device
|
字符串
|
cpu 或 gpu。 |
'cpu'
|
rng_generator
|
Optional[Generator]
|
用于可重现采样的可选 :class: |
None
|
返回
类型 | 描述 |
---|---|
样本张量。 |
源代码在 bionemo/moco/distributions/time/logit_normal.py
中
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|