2.1.6.1.8. sf_tools.signal.proximity module

PROXIMITY OPERATORS

This module contains classes of proximity operators for optimisation

Author:Samuel Farrens <samuel.farrens@gmail.com>
Version:1.3
Date:19/07/2017
class sf_tools.signal.proximity.Positive[source]

Bases: object

Positivity proximity operator

This class defines the positivity proximity operator

op(data, **kwargs)[source]

Operator

This method preserves only the positive coefficients of the input data

Parameters:data (np.ndarray) – Input data array
Returns:
Return type:np.ndarray all positive elements from input data
class sf_tools.signal.proximity.Threshold(weights, thresh_type='soft')[source]

Bases: object

Threshold proximity operator

This class defines the threshold proximity operator

Parameters:
  • weights (np.ndarray) – Input array of weights
  • thresh_type (str {'hard', 'soft'}, optional) – Threshold type (default is ‘soft’)
op(data, extra_factor=1.0)[source]

Operator

This method returns the input data thresholded by the weights

Parameters:
  • data (np.ndarray) – Input data array
  • extra_factor (float) – Additional multiplication factor
Returns:

Return type:

np.ndarray thresholded data

class sf_tools.signal.proximity.LowRankMatrix(thresh, thresh_type='soft', lowr_type='standard', operator=None)[source]

Bases: object

Low-rank proximity operator

This class defines the low-rank proximity operator

Parameters:
  • thresh (float) – Threshold value
  • treshold_type (str {'hard', 'soft'}) – Threshold type (options are ‘hard’ or ‘soft’)
  • lowr_type (str {'standard', 'ngole'}) – Low-rank implementation (options are ‘standard’ or ‘ngole’)
  • operator (class) – Operator class (‘ngole’ only)
op(data, extra_factor=1.0)[source]

Operator

This method returns the input data after the singular values have been thresholded

Parameters:
  • data (np.ndarray) – Input data array
  • extra_factor (float) – Additional multiplication factor
Returns:

Return type:

np.ndarray SVD thresholded data

class sf_tools.signal.proximity.ProximityCombo(operators)[source]

Bases: object

Proximity Combo

This class defines a combined proximity operator

Parameters:operators (list) – List of proximity operator class instances
op(data, extra_factor=1.0)[source]

Operator

This method returns the result of applying all of the proximity operators to the data

Parameters:
  • data (np.ndarray) – Input data array
  • extra_factor (float) – Additional multiplication factor
Returns:

Return type:

np.ndarray result

class sf_tools.signal.proximity.SubIter(data_shape, operator, weights=None, u_init=None)[source]

Bases: object

Sub iteration operator

This class defines the sub-iteration proximity operator

Parameters:
  • data_shape (tuple) – Shape of input data array
  • operator (class) – Proximity operator class
  • weights (np.ndarray) – Array of weights
  • u_init (np.ndarray) – Initial estimate of u
update_weights(weights)[source]

Update weights

This method updates the values of the weights

Parameters:weights (np.ndarray) – Array of weights
update_u()[source]

Update u

This method updates the values of u

op(data)[source]

Operator

Parameters:data (np.ndarray) – Input data array
Returns:
Return type:np.ndarray result