필터 지우기
필터 지우기

How is the layer weights matrix (IW.{i,j}) arranged when a connection has delays?

조회 수: 1 (최근 30일)
Hello all,
I've been looking for this matter in the documentation but I haven't been able to find an answer. According to the documentation, the matrix IW{i,j} is the the matrix describing the weights of the connection going to layer i from j, with size(layer i number of nodes, layer j number of node*number of delays). However it doesn't explain clearly the order of the columns. For example: Does column nº2 contain the weights of the connections coming from node 2 /first delay, or does it contain the weights of the connections coming from node 1 /second delay?
Thanks in advance,
Javier

답변 (2개)

Greg Heath
Greg Heath 2017년 7월 1일
I see no reason why it can't treat delayed signals like ordinary inputs.
Whether MATLAB does that or not, maybe a different story.
Hope this helps.
Give an old man a break and accept this answer
Greg (;>)

Javier Maruenda
Javier Maruenda 2017년 7월 1일
Thanks for the answer Greg,
I have made an experiment to figure out the answer. When the number of delays is increased, the new columns are inserted at the right end of the existing matrix. I include the code used to figure it out in case is useful to anybody. The code is edited from a script created by the nn toolbox.
The code generates a net, trains it and runs it. Then it adds one additional delay and adds additional zeros columns at the end of the IW{1,1} matrix and runs it again. The result is the same in both cases (Shifted 1 position due to the additional delay). This should prove that the new weights are located in the right position as they are not affecting the result.
Regards,
Javier
clear
clc
load engine_dataset
Data = engine_dataset;
for i=1:size(Data,2)
X{i}(1,1) = Data(1,i);
X{i}(2,1) = Data(2,i);
T{i} = Data(1,i);
end
trainFcn = 'trainlm'; % Levenberg-Marquardt backpropagation.
% Create a Time Delay Network
inputDelays = 1:3;
hiddenLayerSize = 5;
net = timedelaynet(inputDelays,hiddenLayerSize,trainFcn);
[x,xi,ai,t] = preparets(net,X,T);
% Setup Division of Data for Training, Validation, Testing
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
% Train the Network
[net,tr] = train(net,x,t,xi,ai);
% Run Network and save results
y1 = net(x,xi,ai);
% Save Network configuration
initialDelays = net.inputWeights{1,1}.delays;
initial_IW = net.IW{1,1};
% Edit Network configuration (Delays and IW matrix)
editedDelays = [1:4];
net.inputWeights{1,1}.delays = editedDelays;
edited_IW = [initial_IW zeros(net.layers{1}.size, net.inputs{1}.size)];
net.IW{1,1} = edited_IW;
[x,xi,ai,t] = preparets(net,X,T);
% Run Network with new configuration
y2 = net(x,xi,ai);

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by