utils module

mlcg_tk.prior_tools.utils.get_nonzero_keys(prior_module)[source]

Function to extract the key combinations of a prior that have a non-zero value for the parameters.

Return type:

Tensor

mlcg_tk.prior_tools.utils.get_prior_domain(name, n=201)[source]

Function to return a tensor with the domain where some common priors are defined

Return type:

Tensor

mlcg_tk.prior_tools.utils.optimal_offset(fit_arr, data_arr)[source]

Find optimal offset such that the difference between arrays is minimized.

This functions returns the solution to the optimization problem of minimizing:

min_{lambda in R} sum_{k=1}^{n} (data_arr[k]-fit_arr[k] + lambda)

This is useful to plot two curves as overlapping as possible.

Return type:

float

mlcg_tk.prior_tools.utils.prior_evaluator(prior_module, key, x)[source]

Evaluate the prior_module for bead combination key over tensor x

Return type:

Tensor

mlcg_tk.prior_tools.utils.symmetrized_keys_generator(order, emb_max=20)[source]

Auxiliar function to generate the symmetric tuples of size order with integers from 1 to emb_max

Return type:

List[Tuple]