pcaIter_v6.m 795 B

1
  1. function pcaNet = pcaIter_v6(bigY, ts_idx, pcaNet) % calc features for T+1 based on output at T yT = bigY(:, ts_idx-1); cT = pcaNet.bigC(:, ts_idx-1); % cT = cT - eps; % IDK if pcaNet.learning == 1 pcaNet.D = updateD_v2(pcaNet.D, cT); pcaNet.W = updateW_v5(pcaNet.W, cT, yT, pcaNet.D, pcaNet.etaW, pcaNet.capW, pcaNet.maxW); pcaNet.M = updateM_v4(pcaNet.M, cT, pcaNet.D, pcaNet.inhibCap, pcaNet.etaM, pcaNet.maxM); end % update outputs for T+1 y = bigY(:,ts_idx); c = updateC_v5(... pcaNet.W, pcaNet.M, y, pcaNet.changeThresh); [maxx, thisCluster] = max(c); pcaNet.bigC(:, ts_idx) = 0; if maxx > 0 pcaNet.clusters = [pcaNet.clusters; thisCluster]; pcaNet.bigC(thisCluster, ts_idx) = c(thisCluster); else pcaNet.clusters = [pcaNet.clusters; 0]; end end