Training Inspection (radionets.evaluatuion.train_inspection)#
Training inspection submodule of radionets.evaluation.
Reference/API#
radionets.evaluation.train_inspection Module#
Functions#
|
Create quickly inspection plots right after the training finished. |
|
|
|
Applies one of currently two normalization methods if the training was normalized |
|
Pads and applies symmetry to half images. |
|
Create first contour of prediction and truth and return the area ratio. |
|
|
|
|
|
Caluclate the jet angle from an image created with gaussian sources. |
|
Checks if a file with sampled images is located in the evaluation folder |
|
|
|
Create a dataloader object, which feeds the data batch-wise |
|
|
|
|
|
Create a dataloader object, which feeds the data batch-wise |
|
function for visualizing the output of a inverse fourier transform. |
|
Create uncertainty plots in Fourier and image space. |
|
Returns the cropped image with the first component of the true image for both prediction and truth. |
|
Put model into eval mode and evaluate test images. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Compute the inverse Fourier transformation |
|
Get n random test and truth images or mean, standard deviation and true images from an already sampled dataset. |
|
|
|
Get predictions for separate architectures. |
|
Load data set from a directory and return it as H5DataSet. |
|
Load model architecture and pretrained weigths. |
|
|
|
interface of ms-ssim Args: X (torch.Tensor): a batch of images, (N,C,[T,]H,W) Y (torch.Tensor): a batch of images, (N,C,[T,]H,W) data_range (float or int, optional): value range of input images. (usually 1.0 or 255) size_average (bool, optional): if size_average=True, ssim of all images will be averaged as a scalar win_size: (int, optional): the size of gauss kernel win_sigma: (float, optional): sigma of normal distribution win (torch.Tensor, optional): 1-D gauss kernel. if None, a new kernel will be created according to win_size and win_sigma weights (list, optional): weights for different levels K (list or tuple, optional): scalar constants (K1, K2). Try a larger K2 constant (e.g. 0.4) if you get a negative or NaN results. Returns: torch.Tensor: ms-ssim results. |
|
|
|
|
|
Makes the necessary preprocessing for the evaluation methods analyzing the whole test dataset. |
|
Applies the normalization, gets and rescales a prediction and performs the inverse Fourier transformation. |
|
Read data saved with save_pred from h5 file. |
|
Rescale the prediction after normalized training |
|
Samples for every pixel in Fourier space from a truncated Gaussian distribution based on the output of the network. |
|
Write test data and predictions to h5 file. |
|
|
|
Basic logging setup. |
|
Symmetry function to complete the images. |
|
|
|
|
|
|
|
Visualizes how the target variables are displayed in fourier space. |
|
Visualizing, if the target variables are displayed in fourier space. |