필터 지우기
필터 지우기

How does matlab solve the samples in neural networks?

조회 수: 1 (최근 30일)
Huang Huang
Huang Huang 2019년 12월 17일
답변: Huang Huang 2019년 12월 19일
Usualy the column represents the sample number.But when I test the following codes, the results(weight1 and weight2) are different.Who would help me? Thank you very much!
%------------
clear
clc
X=[0 0 1;0 1 1;1 0 1;1 1 1];
D=[0; 0; 1; 1];
X=X';
D=D';
net=network;
net.numInputs=1;
net.numLayers=1;
net.OutputConnect=1;
net.inputConnect(1,1)=1;
net.trainFcn='traingd';
net.trainParam.epochs=1;
net1=train(net,X,D);
weight1=net1.IW{1,1}
net2=net;
for k=1:4
net2=train(net2,X(:,k),D(k));
end
weight2=net2.IW{1,1}

채택된 답변

Huang Huang
Huang Huang 2019년 12월 19일
Now,I know why!
In matlab,'traingd' indicates the batch GD method. From above codes,net1 is the batch algorithm,while net2 is the equivalent GD algorithm.
So the difference is right.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Sequence and Numeric Feature Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by