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
|
Build the unfolded ISTA architecture. |
Classes
|
Unfolded Iterative Shrinkage and Thresholding model. |
|
Proximal operator of the L1 norm with a learned threshold. |
- class zea.models.lista.LISTA(*args, **kwargs)[source]¶
Bases:
BaseModelUnfolded 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".
- class zea.models.lista.Prox(*args, **kwargs)[source]¶
Bases:
LayerProximal operator of the L1 norm with a learned threshold.
Applies soft-thresholding,
sign(x) * relu(|x| - threshold), where the threshold issoftplus(alpha)withalphaa single learned weight. The softplus keeps the threshold positive without constraining the weight itself.
- 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