Package parsimony :: Package functions :: Package nesterov :: Module grouptv
[hide private]
[frames] | no frames]

Module grouptv

source code

The :mod:`parsimony.functions.nesterov.grouptv` module contains the loss function and helper functions for group Total variation, Group TV, smoothed using Nesterov's smoothing technique.

Created on Mon May 5 11:46:45 2014

Copyright (c) 2013-2014, CEA/DSV/I2BM/Neurospin. All rights reserved.


Author: Tommy Löfstedt

License: BSD 3-clause.

Classes [hide private]
  GroupTotalVariation
The smoothed Group total variation (Group TV) function
Functions [hide private]
 
A_from_masks(*args, **kwargs) source code
 
linear_operator_from_masks(masks, weights=None)
Generates the linear operator for the group total variation Nesterov function from a mask for a 3D image.
source code
 
A_from_rects(*args, **kwargs) source code
 
linear_operator_from_rects(rects, shape, weights=None)
Generates the linear operator for the group total variation Nesterov function from the rectange of a 3D image.
source code
Variables [hide private]
  __package__ = 'parsimony.functions.nesterov'
Function Details [hide private]

A_from_masks(*args, **kwargs)

source code 
Decorators:
  • @utils.deprecated("linear_operator_from_masks")

linear_operator_from_masks(masks, weights=None)

source code 
Generates the linear operator for the group total variation Nesterov
function from a mask for a 3D image.

Parameters
----------
masks : List of numpy arrays. The mask for each group. Each mask is an
        integer (0 or 1) or boolean numpy array or the same shape as the
        actual data. The mask does not involve any intercept variables.

weights : List of floats. The weights account for different group sizes,
        or incorporates some prior knowledge about the importance of the
        groups. Default value is the square roots of the group sizes.

A_from_rects(*args, **kwargs)

source code 
Decorators:
  • @utils.deprecated("linear_operator_from_rects")

linear_operator_from_rects(rects, shape, weights=None)

source code 
Generates the linear operator for the group total variation Nesterov
function from the rectange of a 3D image.

Parameters
----------
rects : List of lists or tuples with 2-, 4- or 6-tuple elements. The shape
        of the patch of the 1D, 2D or 3D image to smooth. The elements of
        rects has the form ((x1, x2),), ((y1, y2), (x1, x2)) or ((z1, z2),
        (y1, y2), (x1, x2)), where z is the "layers", y rows and x is the
        columns and x1 means the first column to include, x2 is one beyond
        the last column to include, and similarly for y and z. The rect
        does not involve any intercept variables.

shape : List or tuple with 1, 2 or 3 integers. The shape of the 1D, 2D or
        3D image. shape has the form (X,), (Y, X) or (Z, Y, X), where Z is
        the number of "layers", Y is the number of rows and X is the number
        of columns. The shape does not involve any intercept variables.

weights : List of floats. The weights account for different group sizes,
        or incorporates some prior knowledge about the importance of the
        groups. Default value is the square roots of the group sizes.