deepinv.utils#

This module provides various plotting and utility functions. Please refer to the user guide for more information.

Plotting#

User Guide: refer to Plotting for more information.

deepinv.utils.plot

Plots a list of images.

deepinv.utils.plot_curves

Plots the metrics of a Plug-and-Play algorithm.

deepinv.utils.plot_parameters

Plot the parameters of the model before and after training.

deepinv.utils.plot_inset

Plots a list of images with zoomed-in insets extracted from the images.

deepinv.utils.plot_videos

Plots and animates a list of image sequences.

deepinv.utils.plot_ortho3D

Plots an orthogonal view of 3D images.

TensorList#

User Guide: refer to TensorList for more information.

deepinv.utils.TensorList

Represents a list of torch.Tensor with different shapes.

deepinv.utils.zeros_like

Returns a deepinv.utils.TensorList or torch.Tensor with the same type as x, filled with zeros.

deepinv.utils.ones_like

Returns a deepinv.utils.TensorList or torch.Tensor with the same type as x, filled with ones.

deepinv.utils.randn_like

Returns a deepinv.utils.TensorList or torch.Tensor with the same type as x, filled with standard gaussian numbers.

deepinv.utils.rand_like

Returns a deepinv.utils.TensorList or torch.Tensor with the same type as x, filled with random uniform numbers in [0,1].

Other#

User Guide: refer to Other for more information.

deepinv.utils.get_freer_gpu

Returns the GPU device with the most free memory.

deepinv.utils.load_url_image

Load an image from a URL and return a torch.Tensor.

deepinv.utils.get_data_home

Return a folder to store deepinv datasets.

deepinv.utils.load_image

Load an image from a file and return a torch.Tensor.

deepinv.utils.demo.demo_mri_model

Demo MRI reconstruction model for use in relevant examples.