How do you make for get one/zero output?

the result not is iqual to the vector target because i get 0.5 in place of zero. What function i can add to my code for to get the output iqual to the target?
inputs =
Columns 1 through 11
6.3200 6.7800 7.5600 6.8400 9.0000 6.7200 6.5200 6.7400 7.0600 8.8400 6.2600
0 0 0 0 0 0 0 0 0 0 0
Columns 12 through 22
7.6400 8.1400 7.5200 8.0600 6.4800 6.5000 6.6600 7.2400 7.3200 5.1200 8.2400
0 0 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000
Columns 23 through 32
6.7800 8.0200 8.0800 6.6600 7.7800 6.3400 8.3000 9.0000 7.2000 5.7800
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
target =
Columns 1 through 19
0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0
Columns 20 through 32
1 0 1 0 0 1 1 1 0 1 1 0 1
with the code: net=feedforwardnet(10); net.layers{1}.transferfcn='logsig'; net.layers{2}.transferfcn='logsig'; net.divideParam.trainRatio = 100/100; %net.divideParam.valRatio = 10/100; %net.divideParam.testRatio = 10/100; %net = configure(net,inputs,target); net=init(net); %net.iw{1,1} %net.b{1} %net.lw{2,1} net.trainparam.goal=0.001; net.trainparam.epochs=1000; net.trainFcn = 'trainlm'; %[net,tr]=train(net,inputs,target); net=train(net,inputs,target); output=sim(net,inputs) error=mse(target-output)
I get output: logit1
output =
Columns 1 through 11
0.5002 0.5002 0.5008 0.5002 0.9855 0.5002 0.5002 0.5002 0.5003 0.9101 0.5002
Columns 12 through 22
0.5009 0.5027 0.5007 0.5022 0.5002 0.5002 0.5002 0.5062 0.5085 0.5001 0.8629
Columns 23 through 32
0.5010 0.6980 0.7434 0.5006 0.5679 0.5002 0.9006 1.0000 0.5053 0.5001
error =
0.2121

답변 (3개)

dpb
dpb 2013년 10월 9일

0 개 추천

disp([i'>7.5 o'>0.55])
?, maybe?
FRANK
FRANK 2013년 10월 9일

0 개 추천

My dear, I don't understand, could you say me in what place to the code write its?

댓글 수: 1

dpb
dpb 2013년 10월 9일
Any point at which you have the outputs of choice.
It simply demonstrates that you can create a logical vector of 0 and 1 by the comparison of the inputs to a suitably chosen reference level. What you do with that is dependent on your needs.
PS. It would help immeasurably if you would edit your initial question to properly format the code so it's not line-wrapped. Use the {}Code button or just prefix the first line of code with two blanks. Use the preview window to see what it looks like until get it right...

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

FRANK
FRANK 2013년 10월 9일

0 개 추천

net=feedforwardnet(10,'trainlm'); net.layers{1}.transferfcn='tansig'; net.layers{2}.transferfcn='tansig'; net.divideParam.trainRatio = 80/100; net.divideParam.valRatio = 15/100; net.divideParam.testRatio = 15/100; %net = configure(net,inputs,target); %net=init(net); net.iw{1,1} net.b{1} net.lw{2,1} net.trainparam.goal=0.001; net.trainparam.epochs=1000; %net.trainFcn = 'trainlm'; %[net,tr]=train(net,inputs,target); net=train(net,inputs,target); output=sim(net,inputs) error=mse(target-output)

댓글 수: 1

dpb
dpb 2013년 10월 9일
Still not formatted, unfortunately...and would be better if edit the original question, then remove this comment (and I'd follow up by cleaning up this one)

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

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품

질문:

2013년 10월 9일

댓글:

dpb
2013년 10월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by