Error: File: Untitled8.m Line: 7 Column: 1 At least one END is missing: the statement may begin here.

2 Ansichten (letzte 30 Tage)
X = load('diabetes_dataset.csv');
W1 = rand(3,4);
W2 = rand(1,3);
b1 = rand(3,1);
b2 = rand(1,1);
y = [ones(1,50) 2*ones(1,50) 3*ones(1,50)]';
for j = 1:100 %for epoch
for i = 1:150 %for iteration through dataset
x1 = X(i,:)';
z1 = W1*x1 + b1;
a1 = tanh(z1);
z2 = W2*a1 + b2;
a2 = relu(z2);
dz2 = (a2 - y(i)).*reluGradient(a2); %this is delta L
dw2 = dz2*transpose(a1); %The derivative term of Lth
db2 = dz2; %for the bias
g1 = 1 - a1.^2; %Derivative
dz1 = transpose(W2)*dz2 .* g1; %FOr delta l
dw1 = dz1*transpose(x1); %derivative term for lth layer
db1 = dz1; %bias update
W1 = W1 - 0.1*dw1;
b1 = b1 - 0.1*db1;
W2 = W2 - 0.1*dw2;
b2 = b2 - 0.1*db2;
end

Antworten (0)

Kategorien

Mehr zu Large Files and Big Data finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by