Inversion

After initializing, the inversion can be started with IltData.invert().

ILTpy solves the regularized, inversion problem iteratively in this step. The uniform and zero-crossing penalty are adjusted at each iteration. The convergence of algorithm is tested by computing the relative Frobenius norm of \(\mathbf{g}\) (spectrum or distribution) at each iteration \(i\) given by, \(\left\|\mathbf{g}_i-\mathbf{g}_{i-1}\right\|_2 /\left\|\mathbf{g}_i\right\|_2\). The iterations are stopped at the convergence limit defined by IltData.conv_limit or after maximum number of iterations allowed defined by IltData.max_loop.

During inversion, the progress of iterations in percentage, the time elapsed and estimated time left is shown. After inversion, the distribution can be accessed with IltData.g and the fit of the data with IltData.fit.

Inversion examples

1D inversions :

import iltpy as ilt

# Assuming data1D and t1 are numpy arrays with the data and the sampling vector.
data1D_ILT = ilt.iltload(data=data1D,t=t1)

# define an appropriate tau
tau = np.logspace(-1,2,100)
# provide tau and kernel
data1D_ILT.init(tau,kernel=ilt.Exponential())

# invert
data1D_ILT.invert()

See an example for 1D inversion.

Multi-dimensional inversions (all dimensions are inverted) :

The code snippet below demonstrates initialization with exponential kernels along both dimensions and different output sampling vectors.

import iltpy as ilt

# Assuming data2D  is a 2D numpy array and
# t1,t2 are numpy arrays with sampling vectors corresponding to each dimension.

data2D_ILT = ilt.iltload(data=data2D,t=[t1,t2])

# specify appropriate tau (output sampling vector) in both dimensions and specify kernel in both dimensions
tau1 = np.logspace(-2,2,100)
tau2 = np.logspace(-1,3,100)
data2D_ILT.init(tau =[tau1,tau2],kernel=[ilt.Exponential(),ilt.Exponential()])

# invert
data2D_ILT.invert()

# The same scheme can be used for any nD inversion by specifying n number of t, tau and kernels.

This scheme extends naturally to higher dimensions by supplying a list of kernels and output sampling vectors matching the number of dimensions. See an example for 2D inversion or 3D inversion where all dimensions are inverted.

Multi-dimensional inversions (only some dimensions are inverted) :

data2D_ILT = ilt.iltload(data=data2D,t=t1)

# define an appropriate output sampling for the dimension to be inverted
tau1 = np.logspace(-1,2,100)

# initialize
data2D_ILT.init(tau=tau1, kernel=ilt.Exponential())

# invert
data2D_ILT.invert()

See an example for a 2D inversion where only the first dimension is inverted or a 3D inversion where only the first two dimensions are inverted.