zea.models.lista¶

Unfolded convolutional ISTA (LISTA).

LISTA (Gregor and LeCun, 2010) unrolls a fixed number of iterations of the Iterative Shrinkage and Thresholding Algorithm (ISTA) into a neural network, where the measurement and reconstruction operators of every iteration (fold) are learned convolutions and the soft-thresholding step is a learned proximal operator.

>>> import numpy as np
>>> from zea.models.lista import LISTA

>>> model = LISTA(input_shape=(32, 32, 1), folds=3)
>>> model(np.zeros((1, 32, 32, 1))).shape
(1, 32, 32, 1)

Functions

get_lista_network(input_shape[, folds, ...])

Build the unfolded ISTA architecture.

Classes

LISTA(*args, **kwargs)

Unfolded Iterative Shrinkage and Thresholding model.

Prox(*args, **kwargs)

Proximal operator of the L1 norm with a learned threshold.

class zea.models.lista.LISTA(*args, **kwargs)[source]¶

Bases: BaseModel

Unfolded Iterative Shrinkage and Thresholding model.

Initialize a LISTA model.

Parameters:
  • input_shape (tuple) – Input shape (height, width, channels).

  • folds (int, optional) – Number of unfolded ISTA iterations. Defaults to 5.

  • upsampling (int, optional) – Upsampling factor of the output relative to the input. Defaults to 1 (no upsampling).

  • filters (int, optional) – Number of filters in the unfolded convolutions. Defaults to 1.

  • kernel_size (int, optional) – Kernel size of the unfolded convolutions. Defaults to 5.

  • activation (str, optional) – Final activation function, resolved with keras.activations.get(). Defaults to None (linear).

  • name (str, optional) – Model name. Defaults to "lista".

call(*args, **kwargs)[source]¶
get_config()[source]¶

Returns the config of the object.

An object config is a Python dictionary (serializable) containing the information needed to re-instantiate it.

class zea.models.lista.Prox(*args, **kwargs)[source]¶

Bases: Layer

Proximal operator of the L1 norm with a learned threshold.

Applies soft-thresholding, sign(x) * relu(|x| - threshold), where the threshold is softplus(alpha) with alpha a single learned weight. The softplus keeps the threshold positive without constraining the weight itself.

build(input_shape)[source]¶
call(inputs)[source]¶

Apply the proximal operator.

Parameters:

inputs (Tensor) – Input tensor.

Returns:

Soft-thresholded tensor, with the same shape as inputs.

Return type:

Tensor

compute_output_shape(input_shape)[source]¶
zea.models.lista.get_lista_network(input_shape, folds=5, upsampling=1, filters=1, kernel_size=5, activation=None)[source]¶

Build the unfolded ISTA architecture.

Parameters:
  • input_shape (tuple) – Input shape (height, width, channels).

  • folds (int, optional) – Number of unfolded ISTA iterations. Defaults to 5.

  • upsampling (int, optional) – Upsampling factor of the output. Defaults to 1.

  • filters (int, optional) – Number of filters in the unfolded convolutions. Defaults to 1.

  • kernel_size (int, optional) – Kernel size of the unfolded convolutions. Defaults to 5.

  • activation (str, optional) – Final activation function. Defaults to None.

Returns:

The unfolded LISTA model.

Return type:

keras.Model