Training Inspection (radionets.evaluatuion.train_inspection)#

Training inspection submodule of radionets.evaluation.

Reference/API#

radionets.evaluation.train_inspection Module#

Functions#

after_training_plots(conf[, num_images, ...])

Create quickly inspection plots right after the training finished.

analyse_intensity(pred, truth)

apply_normalization(img_test, norm_dict)

Applies one of currently two normalization methods if the training was normalized

apply_symmetry(img_dict)

Pads and applies symmetry to half images.

area_of_contour(ifft_pred, ifft_truth)

Create first contour of prediction and truth and return the area ratio.

calc_blobs(ifft_pred, ifft_truth)

calc_dr(ifft_truth, ifft_pred)

calc_jet_angle(image)

Caluclate the jet angle from an image created with gaussian sources.

check_samp_file(eval_conf)

Checks if a file with sampled images is located in the evaluation folder

create_contour_plots(conf[, num_images, rand])

create_databunch(data_path, fourier, ...)

Create a dataloader object, which feeds the data batch-wise

create_inspection_plots(conf[, num_images, rand])

create_predictions(conf)

create_sampled_databunch(data_path, batch_size)

Create a dataloader object, which feeds the data batch-wise

create_source_plots(conf[, num_images, rand])

function for visualizing the output of a inverse fourier transform.

create_uncertainty_plots(conf[, num_images, ...])

Create uncertainty plots in Fourier and image space.

crop_first_component(pred, truth, blob_truth)

Returns the cropped image with the first component of the true image for both prediction and truth.

eval_model(img, model)

Put model into eval mode and evaluate test images.

evaluate_area(conf)

evaluate_area_sampled(conf)

evaluate_dynamic_range(conf)

evaluate_gan_sources(conf)

evaluate_intensity(conf)

evaluate_intensity_sampled(conf)

evaluate_mean_diff(conf)

evaluate_ms_ssim(conf)

evaluate_ms_ssim_sampled(conf)

evaluate_point(conf)

evaluate_unc(conf)

evaluate_viewing_angle(conf)

flux_comparison(pred, truth, source_list)

get_ifft(array[, amp_phase, scale])

Compute the inverse Fourier transformation

get_images(test_ds, num_images[, rand, indices])

Get n random test and truth images or mean, standard deviation and true images from an already sampled dataset.

get_prediction(conf[, mode])

get_separate_prediction(conf)

Get predictions for separate architectures.

load_data(data_path, mode[, fourier])

Load data set from a directory and return it as H5DataSet.

load_pretrained_model(arch_name, model_path)

Load model architecture and pretrained weigths.

mergeDictionary(dict_1, dict_2)

ms_ssim(X, Y[, data_range, size_average, ...])

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.

plot_contour(ifft_pred, ifft_truth, out_path, i)

plot_length_point(length, vals, mask, out_path)

preprocessing(conf)

Makes the necessary preprocessing for the evaluation methods analyzing the whole test dataset.

process_prediction(conf, img_test, img_true, ...)

Applies the normalization, gets and rescales a prediction and performs the inverse Fourier transformation.

read_pred(path)

Read data saved with save_pred from h5 file.

rescale_normalization(pred, norm_dict)

Rescale the prediction after normalized training

sample_images(mean, std, num_samples, conf)

Samples for every pixel in Fourier space from a truncated Gaussian distribution based on the output of the network.

save_pred(path, img)

Write test data and predictions to h5 file.

save_sampled(conf)

setup_logger([namespace, level])

Basic logging setup.

symmetry(image, key)

Symmetry function to complete the images.

visualize_sampled_unc(i, mean, std, ...)

visualize_source_reconstruction(ifft_pred, ...)

visualize_uncertainty(i, img_pred, ...[, ...])

visualize_with_fourier(i, img_input, ...[, ...])

Visualizes how the target variables are displayed in fourier space.

visualize_with_fourier_diff(i, img_pred, ...)

Visualizing, if the target variables are displayed in fourier space.