Evaluation Utils (radionets.evaluatuion.utils)#

Evaluation utils submodule of radionets.evaluation.

Reference/API#

radionets.evaluation.utils Module#

Functions#

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.

check_outpath(model_path)

Checks if there is already a predictions file in the evaluation folder

check_samp_file(eval_conf)

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

check_vmin_vmax(inp)

Check wether the absolute of the maxmimum or the minimum is bigger.

create_databunch(data_path, fourier, ...)

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

create_sampled_databunch(data_path, batch_size)

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

eval_model(img, model)

Put model into eval mode and evaluate test images.

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.

load_data(data_path, mode[, fourier])

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

load_pre_model(learn, pre_path[, visualize, ...])

Loads a previously saved model as pre-model.

load_pretrained_model(arch_name, model_path)

Load model architecture and pretrained weigths.

make_axes_nice(fig, ax, im, title[, phase, ...])

Create nice colorbars with bigger label size for every axis in a subplot.

mergeDictionary(dict_1, dict_2)

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_config(config)

Parse the toml config file

read_pred(path)

Read data saved with save_pred from h5 file.

rescale_normalization(pred, norm_dict)

Rescale the prediction after normalized training

reshape_2d(array)

Reshape 1d arrays into 2d ones.

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.

set_num_threads(n)

Set the number of threads to use for parallel execution.

source_list_collate(batch)

Collate function for the DataLoader with source list

symmetry(image, key)

Symmetry function to complete the images.

trunc_rvs(mu, sig, num_samples, mode[, ...])

vectorize([ftylist_or_function, target, ...])

A decorator that creates a NumPy ufunc object using Numba compiled code.

Classes#

DataLoader(dataset[, batch_size, shuffle, ...])

Data loader combines a dataset and a sampler, and provides an iterable over the given dataset.

Path(*args, **kwargs)

PurePath subclass that can make system calls.

sampled_dataset(bundle_path)

Class Inheritance Diagram#

Inheritance diagram of radionets.evaluation.utils.sampled_dataset