how to plot this function?

if true
% code
endfunction [finalW, MSE, Numiterations] = gradientDescentLinearNeuron(P, t, lr, ErrorGoal, MaxIterations)
FinalW=(2*rand(1,100)-1)/10;
x=(2*rand(1,100)-1)/10;
x(:);
ErrorGoal=0.15;
lr=0.1;
step=1;
while ((MSE>ErrorGoal)&&(step<=MaxIterations))
y1=FinalW*x;
si=size(FinalW);
y2=ones(si);
y=[y1,y2];
dMSEdw=-1/((length(x)*((sum(t)-y)*x)));
FinalW=FinalW-lr*dMSEdw;
MSE=1/2*(length(x)*((sum(t)-y).^2));
step=step+1;
end
end

댓글 수: 3

madhan ravi
madhan ravi 2018년 11월 1일
P, t, lr, ErrorGoal, MaxIterations??
ariellewin11 ariellewin11
ariellewin11 ariellewin11 2018년 11월 1일
편집: ariellewin11 ariellewin11 2018년 11월 1일
i get them from data lists. external lists.
function [finalW, MSE, Numiterations] = gradientDescentLinearNeuron(P, t, lr, ErrorGoal, MaxIterations)
FinalW=(2*rand(1,100)-1)/10;
x=(2*rand(1,100)-1)/10;
x(:);
ErrorGoal=0.15;
lr=0.1;
step=1;
while ((MSE>ErrorGoal)&&(step<=MaxIterations))
y1=FinalW*x;
si=size(FinalW);
y2=ones(si);
y=[y1,y2];
dMSEdw=-1/((length(x)*((sum(t)-y)*x)));
FinalW=FinalW-lr*dMSEdw;
MSE=1/2*(length(x)*((sum(t)-y).^2));
step=step+1;
end
end
What do you want to plot?
plot(Numiterations,finalW)
What is the error?

답변 (0개)

이 질문은 마감되었습니다.

제품

릴리스

R2018b

질문:

2018년 11월 1일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by