Multi Input Multi Sequence Neural Network

조회 수: 24(최근 30일)
Kamuran Turksoy 2017년 10월 25일
편집: Kenta 2021년 9월 10일
The question is how to define a multi input multi sequence neural network (NN) in Matlab?
There is a way to define multi sequence NN:
x1 = [4 5 6];
x2 = [4 5 6];
y1 = [1 2 3];
y2 = [1 2 3];
x = {[x1;x2]};
y={[y1;y2]};
net = fitnet(1);
net = train(net,x,y);
view(net)
https://www.mathworks.com/help/nnet/ug/multiple-sequences-with-dynamic-neural-networks.html
There is also a way to define multi input NN:
x1 = [4 5 6];
x2 = [4 5 6];
y1 = [1 2 3];
y2 = [1 2 3];
x = {x1;x2};
y=y1;
net = fitnet(1);
net.numinputs = 2;
net.inputConnect = [1 1; 0 0];
net = train(net,x,y);
view(net)
When I try to combine these two conditions:
x1 = [4 5 6];
x2 = [4 5 6];
y1 = [1 2 3];
y2 = [1 2 3];
x = {{[x1;x2]};{[x1;x2]}};
y={y1;y2};
net = fitnet(1);
net.numinputs = 2;
net.inputConnect = [1 1; 0 0];
net = train(net,x,y);
view(net)
I get error:
Error using nntraining.setup>setupPerWorker (line 61)
Inputs X{1,1} is not numeric or logical.
Error in nntraining.setup (line 43)
[net,data,tr,err] = setupPerWorker(net,trainFcn,X,Xi,Ai,T,EW,enableConfigure);
Error in network/train (line 335)
[net,data,tr,err] = nntraining.setup(net,net.trainFcn,X,Xi,Ai,T,EW,enableConfigure,isComposite);

댓글을 달려면 로그인하십시오.

답변(1개)

Kenta 2021년 9월 10일
편집: Kenta 2021년 9월 10일
As of now, you can use custom training loop for deep learning for the multi-input. This is a bit different from what you want, but I believe it helps you.
https://jp.mathworks.com/matlabcentral/fileexchange/74760-image-classification-using-cnn-with-multi-input-cnn

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!