pyhs3.compiled

Compiled negative log-likelihood for minimizers.

CompiledNLL is what pyhs3.Model.compile_nll() returns: the model’s negative log-likelihood (and its gradient) compiled once as a function of a single vector of free parameters, with every constant parameter baked in and the observed and auxiliary data either baked in or passed per call. Its Hessian is compiled on the first call to CompiledNLL.hessian().

Functions

compile_nll(log_prob, free, baked, initial, ...)

Compile -sum(log_prob) as a function of one vector of free scalars.

default_nll_mode(*[, fuse])

PyTensor mode pyhs3.Model.compile_nll() uses by default.

Classes

BatchedCompiledNLL(fn, parameter_names, ...)

Negative log-likelihood evaluated at a batch of parameter vectors.

CompiledNLL(fn, parameter_names, initial, ...)

Negative log-likelihood compiled as a function of one parameter vector.