Final Exam: Neural computation
Instructors: Xaq Pitkow and Krešimir Josić
May 3, 2017
1
Hopfield Net
The Hopfield network has N neurons si ∈ {−1, +1} whose activation can be described by an energy
function
X
E(s) = −
Jij si sj
ij
The synaptic connectivity matrix J is symmetric and is given by the sum of learned patterns
Jij =
p
X
ξiµ ξjµ
µ=1
where µ ∈ {1 . . . p} is the index of each pattern and ξiµ is the activity of neuron i in that pattern. The
dynamics of the Hopfield net are such that at each time, one neuron is randomly selected, and its state
is updated to its lowest energy state given the other neurons.
1. What is the difference in energies ∆Ek between the two possible states of neuron si ? (10 points)
P
∆Ek = −4 j Jkj sj The 4 is because there is a factor of 2 from summing over both i and j and
another factor of 2 from a difference between an energy and its negative, x − (−x) = 2x.
2. Show that when there is only p = 1 pattern, that memorized pattern is a local energy minimum:
changing any single neuronal value from the memorized pattern increases the energy. (20 points)
The connectivity is Jij = ξi ξj . If s = ξ then the energy is
X
X
X
E=−
Jij ξi ξj = −
ξi ξj ξi ξj = −
(ξi )2 (ξj )2 = −N 2
ij
ij
ij
If any single neuron is changed, say sk = −ξk , then the energy is
X
X
E=−
ξi ξj ξi ξj − 2
ξi ξk ξi (−ξk ) − ξk (−ξk )ξk (−ξk )
ij6=k
=−
X
i6=k
(ξi )2 (ξj )2 + 2
ij6=k
X
(ξi )2 (ξk )2 − (ξk )4
i6=k
2
= −(N − 1) + 2(N − 1) − 1
= −N 2 + 4N − 4
Thus the energy for flipping any single neuron increases by 4N − 4, which is positive for N > 1.
This shows that the memorized pattern is a local energy minimum.
1
2
Probabilistic Population Codes
A population of N neurons is tuned to a scalar stimulus s. Each neuron i produces independent responses
ri to a given stimulus s, with Poisson spike count statistics
p(ri |s) =
e−fi (s) fi (s)ri
ri !
(1)
P
where fi (s) = hri |si = ri p(ri |s)ri is the tuning curve of the stimulus. Each neuron has a gaussianshaped tuning curve with the same halfwidth σ and different preferred stimuli si , so
2 /2σ 2
fi (s) = e−(s−si )
Assume that the population size is large and homogeneous enough that the average response
is essentially independent of s. Assume also that the prior distribution over s is flat.
(2)
P
i
fi (s)
1. The population produces a response r to a given stimulus. What is the posterior probability
p(s|r)? (20 points)
Hints: You may find it convenient to compute the log-posterior first, and then exponentiate. Also,
we only care about the dependence on s, so if a term doesn’t depend on s you can just put it in an
unspecified constant. Finally, remember that any quadratic log-probability over all real numbers
is a gaussian distribution.
p(s|r) = p(r|s)p(s) ∝ p(r|s)
Y
= c1
p(ri |s)
(3)
(4)
i
where c1 and all subsequent constants ck are independent of s. It’s easier to handle if we compute
the log posterior:
X
log p(s|r) = c2 +
log p(ri |s)
(5)
i
= c3 +
X
− fi (s) + ri log fi (s)
(6)
i
X −(s − si )2
ri
2σ 2
i
1 X
= c4 − 2
ri s2 − 2ri si s + ri s2i )
2σ i
P
P
ri si
2
i ri
= c5 − s
+s i2
2
2σ
σ
= c5 − as2 + bs
= c4 +
where a =
gaussian:
P
i ri /2σ
2
and b =
P
i ri si /σ
2
(7)
(8)
(9)
(10)
. Since the log-posterior is quadratic, the posterior is
b 1
p(s|r) = N s ,
2a a
P r s
σ2 i i
= N s Pi
,P
i ri
i ri
2
(11)
(12)
2. How does the variance of the posterior depend on the number of spikes produced? on the pattern
of spikes produced? (10 points)
P
Variance decreases with the total number of spikes as σ 2 / i ri : more spikes, more confidence.
But it doesn’t depend on the pattern. This is a very special case where tuning curves have the
same variance.
3
Evidence accumulation
In a set of experiments, Brunton. et al. 1 trained rats to discriminate between two sources of clicks.
The clicks are generated according to two independent Poisson processes, and are played through two
speakers located at either side of the rat’s head. The clicks are generated at a higher rate on one side,
and the rat needs to identify the side with higher frequency. Here your problem is to develop an optimal
observer model for this task.
Use the following notation:
• These two click rates are either λlow or λhigh , with λhigh > λlow ≥ 0.
• In state H R (High rate on Right), clicks are generated at a higher rate, λhigh , on the right. In
state H L , clicks are generated at a higher rate on the left.
Assume that the optimal observer knows the rates λlow and λhigh . Discretize time into small increments of size ∆t, and assume that during each interval there are only four possible observations,
ξ ∈ {10, 01, 11, 00}. Here 00 means no clicks are heard, and 10 means that there is a click on the left
and no click on the right, etc.
1. Use the definition of a Poisson process to show that the likelihoods P (ξ|H R ) of the
different observations in a small interval ∆t are:
P (10|H R ) = λlow ∆t + o(∆t)
P (01|H R ) = λhigh ∆t + o(∆t)
P (11|H R ) = [λlow ∆t + o(∆t)][λhigh ∆t + o(∆t)] = o(∆t)
P (00|H R ) = 1 − (λlow + λhigh )∆t + o(∆t)
and similarly for the H L condition. Remember that the notation o(∆t) denotes any function
= 0. (10 points)
that goes to zero more quickly than ∆t, that is lim∆t→0 o(∆t)
∆t
The log-likelihood ratios, for a fixed ∆t, take the form
log
P (10|H R )
λlow ∆t + o(∆t)
= log
L
P (10|H )
λhigh ∆t + o(∆t)
and similarly for other observations ξ.
Assume that independent observations ξn are made sequentially at each time increment tn = n∆t.
R)
Let a0 = log PP (H
be the log ratio of the priors, and denote the log posterior after the nth observation
(H L )
R
P (H |ξ1:n )
by an = log
.
P (H L |ξ1:n )
1
Brunton BW, Botvinivk MM, Brody CD (2013). Rats and Humans can Optimally Accumulate Evidence for Decisionmaking. Science, 340: 95–98.
3
2. Show that an can be expressed both as a sum of log likelihoods, and recursively as a
function of an−1 . Why is it useful to be able to just update your current belief after each
observation? (10 points)
3. Assume that ∆t is small, and the o(∆t) terms are negligible. Keeping this in mind,
describe this process of evidence accumulation: What happens to the log likelihood an when
there are no clicks? What happens when there is click on the left or the right? (10 points)
4. Suppose that the rat makes a decision when an reaches a threshold θ. Sketch a possible
realization of the clicks arriving from the left and from the right, as well as the corresponding
evolution of an . (10 points)
Solution:
1. This follows directly from the definition of a Poisson process: The probability of a click at high
rate in time bin of size ∆t is λhigh ∆t + o(∆t), and similarly for the lower rate. The rest just follows
from using this to compute the probability of the various events, and noting that (λhigh ∆t +
o(∆t))(λlow ∆t + o(∆t)) = o(∆t).
2.
a0 = log
an+1 =
n+1
X
i=1
P0 (H R )
P0 (H L )
log
L
(ξi )
f∆t
R
f∆t (ξi )
= an + log
L
(ξn+1 )
f∆t
.
R
f∆t (ξn+1 )
(13)
(14)
(15)
It is useful to update your current belief after each observation so you don’t have to remember the
entire history of observations, just the current state.
3. When there is no click then an+1 = an . When there is a click, the log likelihood ratio jumps by
log λlow − log λhigh if the click is on the left, and by log λhigh − log λlow if there is a click on on the
right. The probability that there is a click on both sides is negligible.
4. This is a jump process with jumps at the clicks (Figure 1). The minimal number of clicks to reach
threshold, θ, is d log λhighθ−log λlow e where dxe is the ceiling function (smallest integer bigger than x).
4
evidence an
+
0
–
time
Figure 1: Example realization of the evidence accumulation jump process. Red clicks favor Right, Blue
clicks favor Left. Each click increments the log probability an by a constant amount, ± log (λhigh /λlow ).
Here an excess of four clicks is enough to push the evidence over the threshold −θ (yellow dot).
5
© Copyright 2026 Paperzz