AffineModel#
- class cuqi.model.AffineModel(linear_operator, shift, linear_operator_adjoint=None, range_geometry=None, domain_geometry=None)#
Model class representing an affine model, i.e. a linear operator with a fixed shift. For linear models, represented by a linear operator only, see
LinearModel
.The affine model is defined as:
\[x \mapsto Ax + shift\]where \(A\) is the linear operator and \(shift\) is the shift.
- Parameters:
linear_operator (2d ndarray, callable function or cuqi.model.LinearModel) – The linear operator. If ndarray is given, the operator is assumed to be a matrix.
shift (scalar or array_like) – The shift to be added to the forward operator.
linear_operator_adjoint (callable function, optional) – The adjoint of the linear operator. Also used for computing gradients.
range_geometry (cuqi.geometry.Geometry) – The geometry representing the range.
domain_geometry (cuqi.geometry.Geometry) – The geometry representing the domain.
- __init__(linear_operator, shift, linear_operator_adjoint=None, range_geometry=None, domain_geometry=None)#
Methods
__init__
(linear_operator, shift[, ...])forward
(*args[, is_par])Forward function of the model.
gradient
(direction, wrt[, is_direction_par, ...])Gradient of the forward operator (Direction-Jacobian product)
Attributes
The dimension of the domain
The dimension of the range
The shift of the affine model.