ASSIGNMENT 3 HEBBIAN LEARNING J Elder PSYC 6256
ASSIGNMENT 3: HEBBIAN LEARNING J. Elder PSYC 6256 Principles of Neural Coding
Outline Probability & Bayesian Inference 2 The assignment requires you to Download the code and data Run the code in its default configuration Experiment with altering parameters of the model Optional (for bonus marks): Modify the model, for example to: Incorporate other forms of synaptic normalization Incorporate other learning rules (e. g. , ICA) PSYC 6256 Principles of Neural Coding J. Elder
Dataset Probability & Bayesian Inference 3 I will provide you with 15 natural images of foliage from the Mc. Gill Calibrated Image dataset These images have been prefiltered, using a DOG model of primate LGN selectivity (Hawken & Parker 1991) Thus the input simulates the feedforward input to V 1 PSYC 6256 Principles of Neural Coding J. Elder
Submission Details Probability & Bayesian Inference 4 You will submit a short lab report on your experiments. For each experiment, the report will include: Any code you may have developed The parameter values you tested The graphs you produced The observations you made The conclusions you drew PSYC 6256 Principles of Neural Coding J. Elder
Discussion Questions Probability & Bayesian Inference 5 In particular, I want your reports to answer at least the following questions: Why does Hebbian learning yield the dominant eigenvector of the stimulus autocorrelation matrix? What is the Oja rule and why is it needed? How does adding recurrence create diversity? What is the effect of varying the learning time constants? PSYC 6256 Principles of Neural Coding J. Elder
Graphs Probability & Bayesian Inference 6 The graphs you produce should be as similar as possible to mine. Make sure everything is intelligible! PSYC 6256 Principles of Neural Coding J. Elder
Due Date Probability & Bayesian Inference 7 The report is due Wed Apr 13 PSYC 6256 Principles of Neural Coding J. Elder
Eigenvectors Probability & Bayesian Inference 8 function lgneig(lgnims, neigs, nit) %Computes and plots first neigs eigenimages of LGN inputs to V 1 %lgnims = cell array of images representing normalized LGN output %nit = number of image patches on which to base estimate dx=1. 5; %pixel size in arcmin. This is arbitrary. v 1 rad=round(10/dx); %V 1 cell radius (pixels) Nu=(2*v 1 rad+1)^2; %Number of input units nim=length(lgnims); Q=zeros(Nu); for i=1: nit u=im(y-v 1 rad: y+v 1 rad, x-v 1 rad: x+v 1 rad); u=u(: ); Q=Q+u*u'; %Form autocorrelation matrix end Q=Q/Nu; %normalize [v, d]=eigs(Q, neigs); %compute eigenvectors PSYC 6256 Principles of Neural Coding J. Elder
Output 9 Probability & Bayesian Inference PSYC 6256 Principles of Neural Coding J. Elder
10 Hebbian Learning (Feedforward) Probability & Bayesian Inference function hebb(lgnims, nv 1 cells, nit) %Implements a version of Hebbian learning with the Oja rule, running on simulated LGN %inputs from natural images. %lgnims = cell array of images representing normalized LGN output %nv 1 cells = number of V 1 cells to simulate %nit = number of learning iterations dx=1. 5; %pixel size in arcmin. This is arbitrary. v 1 rad=round(60/dx); %V 1 cell radius Nu=(2*v 1 rad+1)^2; %Number of input units tauw=1 e+6; %learning time constant nim=length(lgnims); w=normrnd(0, 1/Nu, nv 1 cells, Nu); %random initial weights for i=1: nit u=im(y-v 1 rad: y+v 1 rad, x-v 1 rad: x+v 1 rad); u=u(: ); %See Dayan Section 8. 2 v=w*u; %Output %update feedforward weights using Hebbian learning with Oja rule w=w+(1/tauw)*(v*u'-repmat(v. ^2, 1, Nu). *w); end PSYC 6256 Principles of Neural Coding J. Elder
Output 11 Probability & Bayesian Inference PSYC 6256 Principles of Neural Coding J. Elder
12 Hebbian Learning (With Recurrence) Probability & Bayesian Inference function hebbfoldiak(lgnims, nv 1 cells, nit) %Implements a version of Foldiak's 1989 network, running on simulated LGN %inputs from natural images. Incorporates feedforward Hebbian learning and %recurrent inhibitory anti-Hebbian learning. %lgnims = cell array of images representing normalized LGN output %nv 1 cells = number of V 1 cells to simulate %nit = number of learning iterations dx=1. 5; %pixel size in arcmin. This is arbitrary. v 1 rad=round(60/dx); %V 1 cell radius (pixels) Nu=(2*v 1 rad+1)^2; %Number of input units tauw=1 e+6; %feedforward learning time constant taum=1 e+6; %recurrent learning time constant zdiag=(1 -eye(nv 1 cells)); %All 1 s but 0 on the diagonal w=normrnd(0, 1/Nu, nv 1 cells, Nu); %random initial feedforward weights m=zeros(nv 1 cells); for i=1: nit u=im(y-v 1 rad: y+v 1 rad, x-v 1 rad: x+v 1 rad); u=u(: ); %See Dayan pp 301 -302, 309 -310 and Foldiak 1989 k=inv(eye(nv 1 cells)-m); v=k*w*u; %steady-state output for this input %update feedforward weights using Hebbian learning with Oja rule w=w+(1/tauw)*(v*u'-repmat(v. ^2, 1, Nu). *w); %update inhibitory recurrent weights using anti-Hebbian learning m=min(0, m+zdiag. *((1/taum)*(-v*v'))); end PSYC 6256 Principles of Neural Coding J. Elder
Output 13 Probability & Bayesian Inference PSYC 6256 Principles of Neural Coding J. Elder
- Slides: 13