x = min(A,w_J); % Fuzzy version of 2/3 rule. x is F1 activity % NB: We could also use J-th element of S % since the top line of the match fraction % |I and w|/|I| is sum(x), which is % S = sum(A_AND_w) from above

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% Testing if the winning node resonates in ARTa

if sum(x)/sum(A) >= rho_a, % If a match, we're done resonant_a = 1; % ARTa resonates end; % The while resonant_a == 0 command will stop looping % now, so we exit the while loop and go onto to Fab

end; % End of the while loop searching for ARTa resonance % If resonant_a = 0, we pick the next highest Tj % and see if *that* node resonates, i.e. goto "while" % If resonant_a = 1, we have found an ARTa resonance, % namely node J % So we go on to see if we get Fab match with node J

if sum(z)/sum(b) < rho_ab, % We have an Fab mismatch resonant_ab = 0; % This makes us go through % the resonant_ab==0 loop again resonant_a = 0; % This makes us go through % ARTa search again, this % search being inside the % resonant_ab==0 loop % Increase rho_a vigilance. % This will cause F2a node J to get reset when % we go back through the ARTa search loop again. % Also, *for this input*, the above-baseline % vigilance will cause a finer ARTa category to win

if test_mode==1, % If we're testing there can be no Fab mismatch % We just want the prediction. resonant_ab = 1; % This is just to exit the loop test_out(i) = w_ab(:,J)/sum(w_ab(:,J)); % The prediction is the normalised w_ab vector end;

end; %%%%%%%%% End of the while resonant_ab==0 loop. %%%%%%%%% Now we have a resonating ARTa output %%%%%%%%% which gives a match at the Fab layer. %%%%%%%%% So, we go on to have learning %%%%%%%%% in the w_a and w_ab weights