%This program illustrates the tests the DeltaSGD.m function for supervised %training of an artificial neuron. clear all clc %Inputs: X = [0 0 1; 0 1 1; 1 0 1; 1 1 1]; %Desired outputs: D = [0; 0; 1; 1]; W = 2*rand(1, 3) - 1; %initialization of weights % Training process (adjusting weights): for epoch = 1:10000 W = DeltaSGD(W, X, D); end %Inference: N = 4; y = zeros(N,1); for k = 1:N x = X(k, :)'; v = W*x; y(k) = Sigmoid(v); %obtained output. end disp('Results:'); disp(' [desired neuron_output]'); disp([D y]);