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