tsadar.utils.process.postprocess#

Functions

get_sigmas(hess, batch_size)

Calculates the variance using the hessian with respect to the parameters and then using the hessian values as the inverse of the covariance matrix and then inverting that.

postprocess(config, sample_indices, ...)

process_angular_data(config, batch_indices, ...)

process_data(config, sample_indices, ...)

recalculate_with_chosen_weights(config, sa, ...)

Gets parameters and the result of the full forward pass i.e. fits.

refit_bad_fits(config, sa, batch_indices, ...)

tsadar.utils.process.postprocess.recalculate_with_chosen_weights(config: Dict, sa, sample_indices, all_data: Dict, loss_fn: LossFunction, calc_sigma: bool, fitted_weights: Dict)Source#

Gets parameters and the result of the full forward pass i.e. fits

Parameters:
  • config – Dict- configuration dictionary built from input deck

  • sample_indices

  • all_data – Dict- contains the electron data, ion data, and their respective amplitudes

  • loss_fn – Instance of the LossFunction class

  • fitted_weights – Dict- best values of the parameters returned by the minimizer

Returns:

tsadar.utils.process.postprocess.get_sigmas(hess: Dict, batch_size: int) DictSource#

Calculates the variance using the hessian with respect to the parameters and then using the hessian values as the inverse of the covariance matrix and then inverting that. Negatives in the inverse hessian normally indicate non-optimal points, to represent this in the final result the uncertainty of those values are reported as negative.

Parameters:
  • hess – Hessian dictionary, the field for each fitted parameter has subfields corresponding to each of the other fitted parameters. Within each nested subfield is a batch_size x batch_size array with the hessian values for that parameter combination and that batch. The cross terms of this array are zero since separate lineouts within a batch do not affect each other, they are therefore discarded

  • batch_size – int- number of lineouts in a batch

Returns:

sigmas – batch_size x number_of_parameters array with the uncertainty values for each parameter

tsadar.utils.process.postprocess.postprocess(config, sample_indices, all_data: Dict, all_axes: Dict, loss_fn, sa, fitted_weights)Source#
tsadar.utils.process.postprocess.refit_bad_fits(config, sa, batch_indices, all_data, loss_fn, fitted_weights)Source#
tsadar.utils.process.postprocess.process_data(config, sample_indices, all_data, all_axes, loss_fn, fitted_weights, sa, losses_init, t1, td)Source#
tsadar.utils.process.postprocess.process_angular_data(config, batch_indices, all_data, all_axes, loss_fn, fitted_weights, sa, t1, td)Source#