source: prextra/unittm.m @ 5

Last change on this file since 5 was 5, checked in by bduin, 14 years ago
File size: 1.1 KB
RevLine 
[5]1%UNITTM Trainable unit mapping
2%
3%   W = UNITTM(A)
4%   W = A*UNITTM
5%
6% INPUT
7%   A   Array or dataset
8%
9% OUTPUT
10%   W   Unit mapping, if applied to dataset, it is returned unchanged
11%
12% DESCRIPTION
13% This is a trainable unit mapping that maps any dataset on itself.
14% The difference with the fixed mapping is UNITM is that UNITM(A) returns
15% A and that W = UNITTM(A) returns a mapping with input and output
16% dimensionality the feature size of A. Consequently B*W return B, but
17% checks the feature size against A.
18%
19% SEE ALSO
20% MAPPINGS, UNITM
21
22% Copyright: R.P.W. Duin, r.p.w.duin@prtools.org
23% Faculty EWI, Delft University of Technology
24% P.O. Box 5031, 2600 GA Delft, The Netherlands
25
26function w = unittm (a,v)
27
28        prtrace(mfilename);
29
30        if (nargin == 0) | (isempty(a))     % untrained definition
31                w = mapping(mfilename,'untrained');
32                w = setname(w,'Unit Mapping');
33        elseif (nargin == 1) | isempty(v)   % training
34                isdataset(a);
35                [m,k] = size(a);
36                w = mapping(mfilename,'trained',[],getfeatlab(a),k,k);
37        elseif ismapping(v)                 % execution
38                w = a;                            % return input 
39        else
40                error('Un-pars-able call')
41        end
42
43        return
Note: See TracBrowser for help on using the repository browser.