pymc.model.core.FrozenModel#
- class pymc.model.core.FrozenModel(*args, **kwargs)[source]#
A model whose graph is immutable and whose compiled functions are cached.
Create one with
pymc.model.transform.optimization.freeze_model(); this class cannot be instantiated directly. Graph-mutating methods do not exist on it, which is what makes caching safe without any invalidation.set_dataremains available for data that no free variable depends on — values and shapes are runtime inputs of the cached functions.Methods
FrozenModel.__init__(*args, **kwargs)FrozenModel.check_start_vals(start, **kwargs)Check that the logp is defined and finite at the starting point.
FrozenModel.compile_d2logp([vars, jacobian, ...])Compiled log probability density hessian function.
FrozenModel.compile_dlogp([vars, jacobian])Compiled log probability density gradient function.
FrozenModel.compile_fn(outs, *[, inputs, ...])Compiles a PyTensor function.
FrozenModel.compile_logp([vars, jacobian, sum])Compiled log probability density function.
Clone the model.
FrozenModel.d2logp([vars, jacobian, ...])Hessian of the models log-probability w.r.t.
FrozenModel.debug([point, fn, verbose])Debug model function at point.
FrozenModel.dlogp([vars, jacobian])Gradient of the models log-probability w.r.t.
Evaluate shapes of untransformed AND transformed free variables.
FrozenModel.get_context([error_if_none, ...])FrozenModel.initial_point([random_seed])Compute the initial point of the model.
FrozenModel.logp([vars, jacobian, sum])Elemwise log-probability of the model.
FrozenModel.logp_dlogp_function([grad_vars, ...])Compile a PyTensor function that computes logp and gradient.
FrozenModel.name_for(name)Check if name has prefix and adds if needed.
FrozenModel.name_of(name)Check if name has prefix and deletes if needed.
FrozenModel.point_logps([point, round_vals])Compute the log probability of point for all random variables in the model.
FrozenModel.profile(outs, *[, n, point, ...])Compile and profile a PyTensor function which returns
outsand takes values of model vars as a dict as an argument.FrozenModel.replace_rvs_by_values(graphs, ...)Clone and replace random variables in graphs with their value variables.
FrozenModel.set_data(name, values[, coords])Change the values of a data variable in the model.
FrozenModel.set_dim(name, new_length[, ...])Update a mutable dimension.
FrozenModel.table(*[, split_groups, ...])Create a rich table summarizing the model's variables and their expressions.
FrozenModel.to_graphviz(*[, var_names, ...])Produce a graphviz Digraph from a PyMC model.
Attributes
basic_RVsList of random variables the model is defined in terms of.
continuous_value_varsAll the continuous value variables in the model.
coordsCoordinate values for model dimensions.
datalogpPyTensor scalar of log-probability of the observed variables and potential terms.
dim_lengthsThe symbolic lengths of dimensions in the model.
discrete_value_varsAll the discrete value variables in the model.
isrootobservedlogpPyTensor scalar of log-probability of the observed variables.
parentpotentiallogpPyTensor scalar of log-probability of the Potential terms.
prefixrootunobserved_RVsList of all random variables, including deterministic ones.
unobserved_value_varsList of all random variables (including untransformed projections), as well as deterministics used as inputs and outputs of the model's log-likelihood graph.
value_varsList of unobserved random variables used as inputs to the model's log-likelihood (which excludes deterministics).
varlogpPyTensor scalar of log-probability of the unobserved random variables (excluding deterministic).
varlogp_nojacPyTensor scalar of log-probability of the unobserved random variables (excluding deterministic) without jacobian term.