Mapping overload |
Mappings define transformations of vector spaces of possibly different dimensionality. Their size [size_in,size_out] corresponds to these dimensionalities. Consequently they behave somewhat similar as matrices of this size. Linear (affine) mappings are almost identical to such matrices but includes a shift operation. In addition they may carry several other types of information as explained in the mapping definition.
Operations and operators
A number of operations defined for 2-dimensional matrices can be performed on mappings as well. In the below table some examples are given. A, B and R are datasets, W
and V
are mappings, possibly non-linear. Most of these operations are generalizations of the corresponding operations between matrices. Some of the examples apply for affine mappings only.
>
Examples of standard Matlab operations applied to mappings. | |
R = A*W | Generalization of the matrix multiplication. |
R = A*[W V] | R = [A*W A*V] , more on combining mappings. |
R = [A B]*[W;V] | R = [A*W;B*V] , more on combining mappings. |
U = W(:,L) | Restrict the output space to the dimensions in the index vector L . |
U = W+V | Add mappings such that A*U = A*W + A*V. |
U = 3*W - V/2 | Weight and subtract mappings such that A*U = 3*A*W - A*V/2 . |
U = W*V | Execute mappings sequentially, A*U = (A*W)*V in case W and V are fixed or trained mappings. Different rules apply for other mapping types. |
The following Matlab
operators are defined for mappings:
+, -, *, .* , /
The mrdivision
operator +/+ is defined for scalar division only.
Matlab
commands that are overloaded for mappings are: double
, isempty
, size
.
Indexing
The mapping fields might be accessed by structural indexing. Indexing by V = W(I,J) only applies for I = :, so use V = W(:,J). It means that the output space of the mapping is reduced to dimensions listed in J
.
Overloaded commands for affine mappings
As the linear (affine) mappings have a very similar meaning as regular Matlab
matrices, operations defined for matrices work as similar as possible for such mappings. Consequently operations like U = W*V result also internally in a new affine mapping U
if W
and V
are affine. Transpose (W'
) and orthogonalization (orth(W)
) are thereby also defined for affine mappings.
R.P.W. Duin
, January 28, 2013Mapping overload |