Skip to content

Losses API

Complete reference for the torchregress.losses module. Every exported class, factory, and helper is listed here.

→ Guides & decision aids: Loss Functions · Method Selection · Choosing by Constraint


Module overview

All losses share a unified contract:

forward(y_pred, target, mask=None, weights=None) -> Tensor | dict
  • mask: boolean tensor marking valid (True) vs. missing (False) targets.
  • weights: per-sample weight tensor broadcastable to target.
  • Reduction: every loss supports mean / sum / none via the reduction constructor argument.

Base classes

→ Guide: Base Loss Classes

Symbol Signature Description
BaseLoss BaseLoss(reduction="mean") Root class: reduction, mask/weight support
RegressionLoss RegressionLoss(reduction="mean") Point-prediction losses (MSE, Huber, …)
DistributionLoss DistributionLoss(reduction="mean") Distributional losses (Gaussian NLL, MDN, …)
WeightedLossWrapper WeightedLossWrapper(loss_fn, reduction=None) Wraps any nn.Module with mask + weight support
WeightedMSELoss WeightedMSELoss(reduction="mean") nn.MSELoss + mask + weights
WeightedL1Loss WeightedL1Loss(reduction="mean") nn.L1Loss + mask + weights
WeightedHuberLoss WeightedHuberLoss(delta=1.0, reduction="mean") nn.HuberLoss + mask + weights
WeightedCrossEntropyLoss WeightedCrossEntropyLoss(...) nn.CrossEntropyLoss + mask + weights
WeightedNLLLoss WeightedNLLLoss(...) nn.NLLLoss + mask + weights
\[\mathcal{L} = \frac{1}{\sum w_i m_i} \sum w_i m_i \, \ell(y_{\text{pred}, i}, y_i)\]

Gaussian & heteroscedastic

→ Guides: Gaussian losses · Faithful Gaussian · Beta-NLL · Wasserstein bound

Symbol Signature Output
GaussianNLLLoss GaussianNLLLoss(eps=1e-6, reduction="mean") (mean, log_var)
FaithfulGaussianLoss FaithfulGaussianLoss(mean_weight=1.0, variance_weight=1.0) (mean, log_var)
GaussianCRPSLoss GaussianCRPSLoss(eps=1e-6, reduction="mean") (mean, log_var)
BetaNLLLoss BetaNLLLoss(beta=0.5, eps=1e-6, reduction="mean") (mean, log_var)
beta_nll_loss beta_nll_loss(y_pred, target, beta, ...) Functional form of BetaNLLLoss
GaussianWassersteinBoundLoss GaussianWassersteinBoundLoss(covariance_parameterization="diagonal") mean + cov params
gaussian_wasserstein_bound_loss gaussian_wasserstein_bound_loss(pred_mean, target_mean, pred_covariance, target_covariance, ...) Functional form
symmetric_spd_matrix_sqrt symmetric_spd_matrix_sqrt(sigma, *, eps=1e-8) Matrix square root for Wasserstein bound
MultivariateGaussianLoss MultivariateGaussianLoss(...) mean + full Σ
LowRankGaussianLoss LowRankGaussianLoss(min_variance=1e-6, jitter=1e-6, eps=1e-8, reduction="mean") mean + W·Wᵀ + D
create_gaussian_nll create_gaussian_nll(covariance_type="diagonal") Factory
low_rank_output_dim low_rank_output_dim(n_features, rank) → int → See Utilities API
split_low_rank_gaussian_output split_low_rank_gaussian_output(y_pred, n_features, rank) → See Utilities API

Core formulas:

\[\mathcal{L}_{\text{NLL}} = \frac{1}{2} \log(2\pi \sigma^2) + \frac{(y - \mu)^2}{2\sigma^2}\]
\[\mathcal{L}_{\text{CRPS}} = \sigma \bigl[ z(2\Phi(z)-1) + 2\phi(z) - \tfrac{1}{\sqrt{\pi}} \bigr], \quad z = \tfrac{y-\mu}{\sigma}\]
\[\mathcal{L}_{\beta\text{-NLL}} = (\sigma^2 + \varepsilon)^{-\beta} \cdot \mathcal{L}_{\text{NLL}}\]

Robust losses

→ Guide: Robust losses

Symbol Signature Influence
PseudoHuberLoss PseudoHuberLoss(delta=1.0, reduction="mean") C² smooth, linear tail
LogCoshLoss LogCoshLoss(reduction="mean") tanh®, linear tail
CharbonnierLoss CharbonnierLoss(eps=1e-3, reduction="mean") r / √(r² + ε²)
CauchyLoss CauchyLoss(c=1.0, reduction="mean") Logarithmic tail
StudentTLoss StudentTLoss(nu=1.0, scale=1.0, reduction="mean") Student-t NLL; Cauchy at ν=1, Gaussian as ν→∞
TukeyBiweightLoss TukeyBiweightLoss(c=4.685, reduction="mean") Redescending (zero for
AdaptiveRobustLoss AdaptiveRobustLoss(...) Trainable α + scale
BarronLoss BarronLoss(alpha=1.0, scale=1.0, ...) Continuous L1 ↔ L2 family
CVaRLoss CVaRLoss(alpha=0.1, ...) Tail α-fraction
huber_elementwise huber_elementwise(residual, delta=1.0) Elementwise Huber; quadratic/linear crossover at delta
log_cosh log_cosh(residual, scale=1.0) Numerically stable log(cosh(u))
tukey_biweight tukey_biweight(residual, c=4.685) Tukey biweight; constant saturation beyond c
\[\mathcal{L}_{\text{Huber}}(r;\delta) = \begin{cases} \frac{1}{2}r^2 & |r| \le \delta \\ \delta|r| - \frac{1}{2}\delta^2 & |r| > \delta \end{cases}\]

Quantile, expectile, distributional

→ Guides: Quantile & expectile · MDN · Flows · Evidential

Symbol Signature Description
QuantileLoss QuantileLoss(quantile=0.5, reduction="mean") Pinball loss
MultiQuantileLoss MultiQuantileLoss(quantiles=[0.1,0.5,0.9]) Joint pinball
QuantileCrossoverLoss QuantileCrossoverLoss(quantiles=[...]) + non-crossing penalty
ExpectileLoss ExpectileLoss(expectile=0.5, reduction="mean") Asymmetric L2
MultiExpectileLoss MultiExpectileLoss(expectiles=[...]) Joint expectile
ExpectileCrossoverLoss ExpectileCrossoverLoss(expectiles=[...]) + non-crossing penalty (levels must be strictly ascending)
quantile_loss quantile_loss(y_pred, target, quantile=0.5, mask=None, weights=None, reduction="mean") Functional pinball loss
expectile_loss expectile_loss(y_pred, target, expectile=0.5, mask=None, weights=None, reduction="mean") Functional expectile loss
MixtureDensityLoss MixtureDensityLoss(n_components=5, reduction="mean") Mixture Density Network NLL
NormalizingFlowLoss NormalizingFlowLoss(flow=..., reduction="mean") Conditional flow NLL (requires zuko)
NoiseAwareDensityLoss NoiseAwareDensityLoss(base_loss, sigma=None, mode="auto", ...) Marginal likelihood with Gaussian label noise; GH for scalar flows, analytic for diagonal MDNs
BinnedDensityLoss BinnedDensityLoss(bin_edges, label_smoothing=0.0) Smoothed histogram / ordinal-CDF scalar density head
JointBinnedDensityLoss JointBinnedDensityLoss(bin_edges, n_targets=None, max_joint_bins=4096, ...) Joint low-dimensional multi-target binned density/CDF head
CumulativeCDFLoss CumulativeCDFLoss(bin_centers, reduction="mean") Binned CDF squared-error loss
cumulative_cdf_loss cumulative_cdf_loss(logits, target, bin_centers) Functional binned CDF loss
ContrastiveFlowLoss ContrastiveFlowLoss(...) Contrastive likelihood-ratio flow
create_flow_model create_flow_model(n_features, context_dim=0, flow_type="nsf", ...) Factory: NSF/cNSF, MAF, RealNVP/cINN, Bernstein-polynomial (bpf), or transformer autoregressive (tarflow, class torchregress.losses.tarflow.TransformerFlow) flow; bound sets the spline tail bound
recommended_tail_bound recommended_tail_bound(standardized_targets, *, margin=1.25, minimum=5.0, maximum=25.0) → float Tail bound covering the standardized training targets; pass the result as create_flow_model(..., bound=...)
create_flow_loss create_flow_loss(...) Factory: build a flow loss
create_contrastive_flow_loss create_contrastive_flow_loss(...) Factory: build a contrastive flow loss
NeuralRatioLoss NeuralRatioLoss(classifier, *, criterion="bce", reduction="mean") Classifier-based neural ratio estimation; forward(context, observations, negative_context=..., negative_target=None, ...)
build_ratio_classifier build_ratio_classifier(context_dim, observable_dim, hidden_dims=(64,64), activation="silu") Default MLP logit scorer for NRE
neural_ratio_logits neural_ratio_logits(classifier, context, observable) Per-candidate log-ratio logits
neural_ratio_loss neural_ratio_loss(classifier, context, observable, negative_context, negative_target=None, criterion="bce", reduction="mean") Functional NRE loss
EvidentialRegressionLoss EvidentialRegressionLoss(coeff_nig=1e-2, reduction="mean", unconstrained_inputs=True) NIG evidential regression
DiscreteWasserstein1Loss DiscreteWasserstein1Loss(bin_edges=None, from_logits=False, reduction="mean") 1-Wasserstein between mass vectors on a shared grid; see Grid & basis densities
discrete_wasserstein1 discrete_wasserstein1(p, q, centers) Functional form
RankNContrastLoss RankNContrastLoss(temperature=2.0, similarity="l2", reduction="mean") Rank-N-Contrast representation loss (features vs continuous labels)
rank_n_contrast_loss rank_n_contrast_loss(features, labels, temperature, similarity) Per-anchor functional form
RankSimLoss RankSimLoss(gamma=1.0, *, interpolation_strength=2.0, similarity="cosine", duplicate_policy="mean", reduction="mean") RankSim ranking-similarity regularizer for imbalanced regression (compose with a task loss)
rank_sim_regularizer rank_sim_regularizer(features, target, *, interpolation_strength=2.0, similarity="cosine", duplicate_policy="mean", reduction="mean") Functional RankSim form
\[\mathcal{L}_{\text{quantile}} = \max(q(y-\hat{y}), (q-1)(y-\hat{y}))$$ $$\mathcal{L}_{\text{expectile}} = |e - \mathbb{I}(y<\hat{y})| \cdot (y-\hat{y})^2$$ $$\mathcal{L}_{\text{MDN}} = -\log \sum_k \pi_k \mathcal{N}(y \mid \mu_k, \sigma_k^2)\]

Distribution families (losses.families)

Parametric NLL losses for non-Gaussian target families.

Symbol Signature Description
SkewNormalNLLLoss SkewNormalNLLLoss(...) Skew-normal NLL (Azzalini 1985); reduces exactly to Gaussian NLL at α=0
skew_normal_nll skew_normal_nll(...) Functional skew-normal NLL
SkewTLoss SkewTLoss(...) Skew-t NLL (Azzalini & Capitanio 2003), lgamma-normalized
skew_t_nll skew_t_nll(...) Functional skew-t NLL
BetaRegressionNLLLoss BetaRegressionNLLLoss(...) Beta-regression NLL (Ferrari & Cribari-Neto 2004) for targets in (0, 1)
beta_regression_nll beta_regression_nll(...) Functional beta-regression NLL
JohnsonSUNLLLoss JohnsonSUNLLLoss(...) Johnson-SU NLL with Shenton-quadrant (γ, δ) shapes
johnson_su_nll johnson_su_nll(...) Functional Johnson-SU NLL
SinhArcsinhNLLLoss SinhArcsinhNLLLoss(...) Sinh-arcsinh NLL (Jones & Pewsey 2009); Gaussian at ε=0, δ=1
sinh_arcsinh_nll sinh_arcsinh_nll(...) Functional sinh-arcsinh NLL
GEVNLLLoss GEVNLLLoss(...) GEV NLL with an analytic Gumbel limit as ξ → 0
gev_nll gev_nll(...) Functional GEV NLL
AsymmetricLaplaceNLLLoss AsymmetricLaplaceNLLLoss(...) Asymmetric-Laplace NLL; reduces to the scaled pinball NLL at a common tail scale
asymmetric_laplace_nll asymmetric_laplace_nll(...) Functional asymmetric-Laplace NLL
SQRLoss SQRLoss(...) Distributional quantile regression via sorted levels + mean pinball
sqr_loss sqr_loss(...) Functional SQR loss over n_levels sorted quantile levels

Special target types

→ Guides: Censored · Ordinal · Poisson & Tweedie · Poisson-Gaussian

Ordinal

Symbol Signature Output
CumulativeLinkLoss CumulativeLinkLoss(reduction="mean", level_weights=None, pos_weight=None) K-1 logits. CORALHead supplies the shared-weight constraint; the loss is this class.
OrdinalCrossEntropyLoss OrdinalCrossEntropyLoss(...) K logits

Censored / survival

Symbol Signature Description
CensoredGaussianNLLLoss CensoredGaussianNLLLoss(reduction="mean") Gaussian + Φ censoring
CensoredQuantileLoss CensoredQuantileLoss(...) Quantile + censoring
AFTLoss AFTLoss(...) Accelerated Failure Time
\[\mathcal{L}_{\text{censored}} = \begin{cases} \tfrac{1}{2}\log(2\pi\sigma^2) + \tfrac{(y-\mu)^2}{2\sigma^2} & c=0 \\ -\log\Phi(\tfrac{y-\mu}{\sigma}) & c=-1 \\ -\log(1-\Phi(\tfrac{y-\mu}{\sigma})) & c=1 \end{cases}\]

Count data

Symbol Signature Variance
PoissonDevianceLoss PoissonDevianceLoss(log_input=True, ...) Var = μ
PoissonLikelihoodRatioLoss PoissonLikelihoodRatioLoss(log_input=True, ...) Var = μ (binned)
NegativeBinomialNLLLoss NegativeBinomialNLLLoss(learn_theta=False, ...) Var = μ + μ²/r
ZeroInflatedPoissonNLLLoss ZeroInflatedPoissonNLLLoss(log_input=True, ...) ZIP
TweedieLoss TweedieLoss(p=1.5, link="log") Var = φ μ^p
GammaLoss GammaLoss(link="log") Var = φ μ²
InverseGaussianLoss InverseGaussianLoss(link="log") Var = φ μ³
CompoundPoissonLoss CompoundPoissonLoss(p=1.5, link="log") 1 < p < 2
tweedie_loss tweedie_loss(y_pred, target, p=1.5, ...) Functional Tweedie loss
PoissonGaussianLoss PoissonGaussianLoss(gain=1.0, offset=0.0, read_noise_variance=1.0, ...) Poisson shot noise convolved with Gaussian read noise: g²λ + σ²
PoissonGaussianContaminationMixtureLoss PoissonGaussianContaminationMixtureLoss(log_input=True, ...) Two-component Poisson/Gaussian mixture (not the detector model)
EnhancedPoissonGaussianContaminationMixtureLoss EnhancedPoissonGaussianContaminationMixtureLoss(...) Mixture with gain/offset/learnable noise (not the detector model)
PoissonGaussianLikelihoodRatioLoss PoissonGaussianLikelihoodRatioLoss(...) Likelihood-ratio variant

Data quality issues

→ Guides: Imbalanced · PRIME & ConR · Uncertain GT · Noisy labels

Symbol Signature Strategy
BalancedMSELoss BalancedMSELoss(bin_edges, ...) Inverse bin-frequency weights
BalancedMSEBMC BalancedMSEBMC(*, sigma=None, prior="histogram", num_bins=64, prior_bandwidth=None, kde_points=2048, prior_floor=1e-6, min_sigma=1e-6, reduction="mean") True noise-adaptive Balanced MSE (BMC) of Ren et al. 2022; batch-coupled
balanced_mse_bmc_loss balanced_mse_bmc_loss(y_pred, target, log_prior, sigma, *, mask=None, weights=None, reduction="mean") Functional BMC form
BinReweightedMSELoss BinReweightedMSELoss(num_bins, *, noise_sigma=1.0, binning="equal", ...) Binned inverse-frequency weighted MSE
DensityWeightedLoss DensityWeightedLoss(...) Inverse target-density weights
FocalRLoss FocalRLoss(gamma=2.0, ...) Focus on hard examples
LDSLoss LDSLoss(...) Label Distribution Smoothing
FeatureDistributionSmoother FeatureDistributionSmoother(...) Feature Distribution Smoothing
PropensityWeightedLoss PropensityWeightedLoss(...) Inverse propensity weights
PrimeLoss PrimeLoss(feature_dim, n_proxies=100, *, label_range=None, class_balanced=False, ...) PRIME proxy alignment (learnable proxies, uniform target spacing)
ConR ConR(*, label_threshold=0.2, prediction_threshold=None, temperature=0.07, push_scale=0.2) ConR contrastive collapse penalty; forward(features, target, prediction=..., ...)
conr_loss conr_loss(features, labels, predictions, *, label_threshold=0.2, prediction_threshold=None, temperature=0.07, push_scale=0.2, density_weights=None, label_sigma=None) Functional per-anchor ConR regularizer (Keramati et al. 2024)
uniform_proxy_targets uniform_proxy_targets(y_min, y_max, n_proxies) Evenly spaced learnable-proxy targets for PrimeLoss
UncertaintyAwareConR UncertaintyAwareConR(*, label_sigma=..., label_threshold=0.2, ...) ConR with Gaussian-uncertainty-softened pair membership
NoisyTargetGaussianNLL NoisyTargetGaussianNLL(reduction="mean") Adds known target-noise σ²_y
PseudoLabelNLL PseudoLabelNLL(pseudo_weight=0.8, ...) Pseudo-label + confidence NLL
ConsistencyRegLoss ConsistencyRegLoss(reduction="mean") Student–teacher MSE
PseudoLabelConsistencyLoss PseudoLabelConsistencyLoss(confidence_threshold=0.9, ...) Pseudo-label + teacher consistency

Error-in-variables (EIV)

→ Guides: EIV losses · Split-measurement & corrected-score · Algorithms: SIMEX · RC · LatentNN · Forward inversion

Call pattern: construct with model=..., then loss(x_obs, y_obs, mask=...).

Symbol Constructor
BaseEIVLoss BaseEIVLoss(model, sigma_x, sigma_y=None, reduction="mean", eps=1e-3): base class of the EIV losses below (sigma/covariance handling); subclass it for a custom EIV loss
StructuralEIVLoss StructuralEIVLoss(model=..., sigma_x=..., sigma_y=..., sigma_xy=...)
FunctionalEIVLoss FunctionalEIVLoss(model=..., sigma_x=0.5, sigma_y=0.3)
OrthogonalDistanceRegressionLoss OrthogonalDistanceRegressionLoss(model=...)
EnsembleEIVLoss EnsembleEIVLoss(model=...)
InputNoiseAugmentationLoss InputNoiseAugmentationLoss(...)
InputNoiseMDNLoss InputNoiseMDNLoss(...)
InputNoiseBinnedPDFLoss InputNoiseBinnedPDFLoss(...)
LatentMarginalizationLoss LatentMarginalizationLoss(...)
NoisyInputPredictor NoisyInputPredictor(...)
SplitMeasurementLoss SplitMeasurementLoss(model, reduction="mean"); forward(x1, y, y_pred_second=x2, ...) — paired independent measurements, no sigma_x needed
split_measurement_loss split_measurement_loss(model, x_first, target, x_second, reduction="mean") — functional paired-measurement loss
CorrectedScoreEIVLoss CorrectedScoreEIVLoss(model, sigma_x, stabilize="none", jacobian_chunk_size=None) — Stefanski–Nakamura corrected score
corrected_score_eiv_loss corrected_score_eiv_loss(model, y_pred, target, sigma_x, reduction="mean", eps=1e-3, stabilize="none", jacobian_chunk_size=None) — functional corrected score

Conformal prediction

→ Guides: Conformal overview · Predictors · Distributional · API: Conformal API

Symbol Signature Strategy
ConformalLoss ConformalLoss(method="cqr", alpha=0.1) Training + calibration wrapper
ConformalPredictor ConformalPredictor(...) Base post-hoc calibrator
SplitConformal SplitConformal(alpha=0.1) Residual-based
CQR CQR(alpha=0.1) Conformalized Quantile Regression
UACQR UACQR(alpha=0.1, ...) Width-normalized CQR
DensityConformal DensityConformal(alpha=0.1) Density-weighted residuals
MonteCarloConformal MonteCarloConformal(alpha=0.1) MC-sample normalized
LocalConformal LocalConformal(alpha=0.1, bandwidth=1.0) Local feature-space coverage
LocalConformalMAD LocalConformalMAD(alpha=0.1, ...) Local + MAD scaling
CTI CTI(alpha=0.1, grid_size=500) Density thresholded intervals
ConformalizedDensity ConformalizedDensity(alpha=0.1, grid_size=500, *, chunk_size=131072) Split-conformal level sets for any conditional log-density
ContrastiveFlowConformal ContrastiveFlowConformal(flow_loss, alpha=0.1) Conformal level sets around a contrastive-flow positive density
WaldoConformal WaldoConformal(alpha=0.1, critical_bins=None, critical_value_regressor=None, covariance_type="diagonal") Wald-statistic confidence regions from conditional mean/covariance
WaldoCriticalValueRegressor WaldoCriticalValueRegressor(alpha=0.1, n_bins=10, min_samples_per_bin=8) Simulator-free local/quantile critical-value approximation for WALDO
waldo_statistic waldo_statistic(mean, target, covariance=None, *, covariance_type="diagonal", eps=1e-8) Per-row Wald statistic \((\mu-y)^\top\Sigma^{-1}(\mu-y)\)
WaldoPosteriorCalibrator WaldoPosteriorCalibrator(alpha=0.1, covariance_type="full") WALDO calibration from predictive samples
WaldoDensityConformal WaldoDensityConformal(alpha=0.1, covariance_type="full", n_samples=256) Simulator-free WALDO regions from a conditional-density sampler
DistributionalConformal DistributionalConformal(alpha=0.1) PIT-based CDF calibration
LevelSetConformalPredictor LevelSetConformalPredictor(alpha=0.1) Smallest density sets
MultiTargetConformal MultiTargetConformal(alpha=0.1) Multi-target joint coverage
MultivariateScoreConformal MultivariateScoreConformal(alpha, score_fn="mahalanobis") Joint ellipsoid from a scalar Mahalanobis / Gaussian-NLL score of (mu, Sigma); optional importance weights
NonExchangeableConformalRegressor NonExchangeableConformalRegressor(alpha, *, normalize_weights=True) Weighted (NexCP) split conformal beyond exchangeability, with two_sided_coverage_bounds()
PrevalenceAdjustedCP PrevalenceAdjustedCP(alpha=0.1) Group-prevalence-adjusted
R2CConformal R2CConformal(alpha=0.1, bin_edges=...) Regression-as-classification CP
SLSConformal SLSConformal(alpha=0.1, ...) Super-level set conformal
CVPlus CVPlus(alpha=0.1) Cross-validation ensemble CP. Leave-one-out (K = n) is the jackknife+ case.
EnsembleBatchCP EnsembleBatchCP(alpha=0.1) Bootstrap/OOB ensemble CP

Conformal guarantee: $\(P(Y_{n+1} \in \hat{C}(X_{n+1})) \geq 1 - \alpha\)$


Transforms & SLS

→ Guides: Transforms · SLS

Symbol Signature Description
LogTransformLoss LogTransformLoss(reduction="mean") log(ŷ) → base loss
BoxCoxTransformLoss BoxCoxTransformLoss(lam=0.0, ...) Box–Cox → base loss
SqrtTransformLoss SqrtTransformLoss(reduction="mean") √ŷ → base loss
YeoJohnsonTransformLoss YeoJohnsonTransformLoss(lam=1.0, ...) Yeo–Johnson → base loss
TransformedTargetLoss TransformedTargetLoss(transform="log", ...) Generic wrapper
SLSLoss SLSLoss(d=2, context_dim=64, K=1, tau=0.9) Super-Level-Set regression
VolumePreservingFlow — Flow with det(J)=1
MahalanobisFrontier — Mahalanobis-based SLS frontier
UnionFrontier — Multimodal SLS frontier

Registry

Symbol Signature
get_regression_loss get_regression_loss(name)
list_regression_losses list_regression_losses()
create_loss_from_config create_loss_from_config(config)

Multi-source Gaussian observations

PackedObservations holds padded measurement values, masks, local observation-map means and Jacobians, and a possibly correlated measurement covariance. MarginalizedMultiSourceGaussianNLLLoss jointly marginalizes a shared latent Gaussian for the supplied linearized map; see the multi-source guide for shape, precision and interpretation details.

GaussianLatentForwardObservationNLLLoss integrates a scalar Gaussian latent through a differentiable nonlinear observation map using adaptive (posterior-centred) Gauss–Hermite quadrature, exact for linear maps and accurate for narrow observation noise. It does not automatically combine dependent observations; see the multi-source guide.

RobustMultiSourceGaussianNLLLoss adds a normalized mixture of measurement-block outlier models to the shared-latent likelihood. It preserves within-block covariance, rejects cross-block measurement covariance and explicitly bounds its exponential assignment enumeration.