agnoPlotting_2D_full.m 2.8 KB

1
  1. function agnoPlotting_2D(bigY, mmNet, pcaNet, ts_idx ,iterations) yT = bigY(:, ts_idx-1); cT = pcaNet.bigC(:, ts_idx-1); figure(1) if pcaNet.learning == 1 plot(mmNet.allErrors(1:ts_idx), 'r-'); else plot(mmNet.allErrors(1:ts_idx), 'k-'); end hold on; refline(0, pcaNet.sigmaThresh); hold off; title(['Total Error over Time - ts: ' num2str(ts_idx)]) xlabel('Timestep') ylabel('Error') xlim([0 iterations]) ylim([0 5]) pause(1e-5) % activityPlot = zeros(7,2); % threshPts = zeros(7,2); % for cIdx = 1:7 % activityPlot(cIdx,:) = cT(cIdx) .* (pcaNet.W(cIdx,:) ./ norm(pcaNet.W(cIdx,:))); % % effectiveExcite = 1 - exp((-pcaNet.excitability(cIdx)/5).^3); % actThresh = 1 - effectiveExcite; % this is now a vector; great % threshPts(cIdx,:) = actThresh .* (pcaNet.W(cIdx,:) ./ norm(pcaNet.W(cIdx,:))); % end colors = {'r.', 'b.', 'g.', 'c.', 'm.', 'k.', 'y.'}; for cIdx = 1:7 thisClust = find(pcaNet.clusters == cIdx); figure(5); plot(bigY(1, thisClust), bigY(2, thisClust), colors{cIdx}) % if ts_idx == 2 hold on; % end end % title('Clustered Data') figure(5) plotv(pcaNet.W(1,:)', 'r') % plotv(activityPlot(1,:)', 'r*') % plotv(threshPts(1,:)', 'kx') plotv(pcaNet.W(2,:)', 'b') % plotv(activityPlot(2,:)', 'b*') % plotv(threshPts(2,:)', 'kx') plotv(pcaNet.W(3,:)', 'g') % plotv(activityPlot(3,:)', 'g*') % plotv(threshPts(3,:)', 'kx') plotv(pcaNet.W(4,:)', 'c') % plotv(activityPlot(4,:)', 'c*') % plotv(threshPts(4,:)', 'kx') plotv(pcaNet.W(5,:)', 'm') % plotv(activityPlot(5,:)', 'm*') % plotv(threshPts(5,:)', 'kx') plotv(pcaNet.W(6,:)', 'k') % plotv(activityPlot(6,:)', 'k*') % plotv(threshPts(6,:)', 'kx') plotv(pcaNet.W(7,:)', 'y') % plotv(activityPlot(7,:)', 'y*') % plotv(threshPts(7,:)', 'kx') hold off; title(['Clusters and Weights, iteration: ' num2str(ts_idx)]) if ts_idx == 2 figure(10) plot(bigY(1,:), bigY(2,:), 'k.') hold on; plotv(pcaNet.W(1,:)', 'r') plotv(pcaNet.W(2,:)', 'b') plotv(pcaNet.W(3,:)', 'g') plotv(pcaNet.W(4,:)', 'c') plotv(pcaNet.W(5,:)', 'm') plotv(pcaNet.W(6,:)', 'k') plotv(pcaNet.W(7,:)', 'y') end if ts_idx == iterations figure(20) plot(1:100, mmNet.allErrors(1:100), 'r-'); hold on; plot(101:200, mmNet.allErrors(101:200), 'b-'); plot(201:300, mmNet.allErrors(201:300), 'k-'); end figure(25) plot(ts_idx, norm(pcaNet.W(1,:)), 'r.') if ts_idx == 2 hold on; end plot(ts_idx, norm(pcaNet.W(2,:)), 'b.') plot(ts_idx, norm(pcaNet.W(3,:)), 'g.') plot(ts_idx, norm(pcaNet.W(4,:)), 'c.') plot(ts_idx, norm(pcaNet.W(5,:)), 'm.') plot(ts_idx, norm(pcaNet.W(6,:)), 'k.') plot(ts_idx, norm(pcaNet.W(7,:)), 'y.') xlim([0 iterations]) title('Weight Magnitudes') ylabel('Norm of Weight') xlabel('Timestep')