scvi.external.drvi.LogNegativeBinomial#
- class scvi.external.drvi.LogNegativeBinomial(log_m, log_r, log_scale=None, validate_args=False)[source]#
Bases:
DistributionNegative binomial distribution parameterized in log space.
A negative binomial whose mean and dispersion are supplied as
log_m(\(\log\mu\)) andlog_r(\(\log\theta\)). The log-probability is the standard negative-binomial log-probability, but rewritten so that it is evaluated directly from the log-parameters viasoftplus()— this avoids ever materializing \(\mu\) or \(\theta\) and is numerically stable for very small/large means. This is DRVI’s “pnb” likelihood and is what enables the additive (log-space) split decoder.Mathematically equivalent to
scvi.distributions.NegativeBinomialwithmu = exp(log_m),theta = exp(log_r).- Parameters:
log_m (
Tensor) – Log of the mean \(\log\mu\).log_r (
Tensor) – Log of the inverse-dispersion \(\log\theta\) (theta = exp(log_r)).log_scale (
Tensor|None(default:None)) – Optional log of the library-size-independent normalized mean, exposed asscaleforRNASeqMixin(e.g.log_softmaxof the decoder output).validate_args (
bool(default:False)) – Raise ValueError if arguments do not match constraints.
Attributes table#
Methods table#
|
Return a named mean-space parameter (RNASeqMixin contract). |
|
Negative-binomial log-probability evaluated from the log-parameters. |
|
Sample via the Gamma-Poisson mixture (same as a negative binomial). |
Attributes#
- LogNegativeBinomial.arg_constraints = {'log_m': Real(), 'log_r': Real()}#
- LogNegativeBinomial.support = IntegerGreaterThan(lower_bound=0)#
Methods#
- LogNegativeBinomial.get_normalized(key)[source]#
Return a named mean-space parameter (RNASeqMixin contract).
- Return type: