-
Notifications
You must be signed in to change notification settings - Fork 0
/
pseudoinverse.m
22 lines (21 loc) · 892 Bytes
/
pseudoinverse.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function outputWeights = pseudoinverse(stateCollectMat,teachCollectMat)
% PSEUDOINVERSE computes the outputWeights using the standard pseudoinverse
% operation
%
% inputs:
% stateCollectMat = matrix of size (nTrainingPoints-nForgetPoints) x
% nInputUnits + nInternalUnits
% stateCollectMat(i,j) = internal activation of unit j after the
% (i + nForgetPoints)th training point has been presented to the network
% teacherCollectMat is a nSamplePoints * nOuputUnits matrix that keeps
% the expected output of the ESN
% teacherCollectMat is the transformed(scaled, shifted etc) output see
% compute_teacher for more documentation
%
% output:
% outputWeights = vector of size (nInputUnits + nInternalUnits) x 1
% containing the learnt weights
%
% Created April 30, 2006, D. Popovici
% Copyright: Fraunhofer IAIS 2006 / Patent pending
outputWeights = (pinv(stateCollectMat)*teachCollectMat)';