%This program calls in the function DeltaBatch.m for supervised training of %a neural network. clear all clc X = [0 0 1; 0 1 1; 1 0 1; 1 1 1]; D = [0; 0; 1; 1]; W = 2*rand(1, 3) - 1; %Training (adjusting weights): for epoch = 1:40000 W = DeltaBatch(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]);