# 6. Parameter learning in Spiking Neural Networks#

Author: Christian Pehle

As we have already seen in Introduction to spiking systems Neuron models come with parameters, such as membrane time constants, which determine their dynamics. While those parameters are often treated as arbitrarily treated constants and therefore hyperparameters in a machine learning context, more recently it has become clear that it can be benefitial to treat them as parameters. In this notebook, we will first learn how to initialise a network of LIF neurons with distinct, but fixed time constants and voltage thresholds and then how to incorporate them into the optimisation. As we will see, this is largely facilitated by the pre-existing ways of treating parameters in PyTorch.

import torch
import norse
import matplotlib.pyplot as plt


## 6.1. Defining a Network of LIF Neurons with varying membrane time-constants#

A population of recurrently connected LIF neurons can be instantiated in Norse as follows:

from norse.torch.module import LIFRecurrentCell

m = LIFRecurrentCell(input_size=200, hidden_size=100)
m

LIFRecurrentCell(input_size=200, hidden_size=100, p=LIFParameters(tau_syn_inv=tensor(200.), tau_mem_inv=tensor(100.), v_leak=tensor(0.), v_th=tensor(1.), v_reset=tensor(0.), method='super', alpha=tensor(100.)), autapses=False, dt=0.001)


As you can see the LIFParameters are initialised to some default values. It is easy enough to instead sample these values from a given distribution. While we will use a random normal distribution here, a more appropriate choice would be for example a lognormal distribution, as this would guarantee that the inverse membrane time constant remains positive, which is an essential requirement. Here we just choose the standard deviation in such a way, that a negative value would be very unlikely.

import numpy as np

counts, bins = np.histogram(norse.torch.functional.lif.LIFParameters().tau_mem_inv + 20*torch.randn(100))
plt.hist(bins[:-1], bins, weights=counts, histtype='step')
plt.xlabel('$\\tau_{m}^{-1}$ [ms]')

Text(0.5, 0, '$\\tau_{m}^{-1}$ [ms]')


The parameters of a PyTorch module can be accesses by invoking the parameters method. In the case of the LIFRecurrentCell those are the recurrent and input weight matrices. Note how both tensors have requires_grad=True and that the LIFParameters do not appear. This is because none of the tensors entering the LIFParameters have been registered as a PyTorch Parameter.

list(m.parameters())

[Parameter containing:
tensor([[ 0.0641,  0.0917, -0.0216,  ..., -0.0606,  0.0100, -0.1328],
[ 0.0496,  0.0216,  0.0398,  ...,  0.1594, -0.0821,  0.1114],
[-0.2399, -0.0469,  0.1719,  ..., -0.1555, -0.1605, -0.0080],
...,
[ 0.0936,  0.1728,  0.1829,  ...,  0.0413,  0.0906,  0.1265],
[-0.0064, -0.1457, -0.1548,  ...,  0.0846, -0.0229, -0.0112],
[-0.1280,  0.1208, -0.2316,  ...,  0.0879, -0.3103,  0.2577]],
Parameter containing:
tensor([[ 0.0000, -0.0620, -0.0727,  ...,  0.1157, -0.1746,  0.0023],
[-0.3871,  0.0000, -0.0223,  ..., -0.0500, -0.0915,  0.1212],
[-0.1279,  0.1285,  0.0000,  ...,  0.0327, -0.1412, -0.0153],
...,
[ 0.0855, -0.1226,  0.0894,  ...,  0.0000, -0.1762,  0.0532],
[ 0.1600, -0.0717,  0.0061,  ..., -0.0803,  0.0000, -0.1924],
[-0.1249, -0.0236, -0.1705,  ...,  0.2623, -0.0206,  0.0000]],


The easiest way to rectify this situation is to define an additional torch.nn.Module and explicitely register the inverse membrane time constant and threshold as a parameter.

class ParametrizedLIFRecurrentCell(torch.nn.Module):
def __init__(self, input_size, hidden_size):
super(ParametrizedLIFRecurrentCell, self).__init__()
self.tau_mem_inv = torch.nn.Parameter(norse.torch.functional.lif.LIFParameters().tau_mem_inv + 20*torch.randn(hidden_size))
self.v_th = torch.nn.Parameter(0.5 + 0.1 * torch.randn(hidden_size))
self.cell = norse.torch.module.LIFRecurrentCell(input_size=input_size, hidden_size=hidden_size,
p = norse.torch.functional.lif.LIFParameters(
tau_mem_inv = self.tau_mem_inv,
v_th = self.v_th,
alpha = 100,
)

)

def forward(self, x, s = None):
return self.cell(x, s)

m = ParametrizedLIFRecurrentCell(200, 100)
m

ParametrizedLIFRecurrentCell(
(cell): LIFRecurrentCell(
input_size=200, hidden_size=100, p=LIFParameters(tau_syn_inv=tensor(200.), tau_mem_inv=Parameter containing:
tensor([ 44.2153, 134.8056, 106.5274,  76.2193, 110.3561,  98.9436,  92.4694,
84.5900,  98.2603, 106.6031,  71.4488, 137.1534,  78.1043, 125.3926,
100.4716,  75.9578,  83.7101, 102.5823, 107.7456,  87.9833, 105.4434,
63.4978,  76.7190,  91.1155, 135.7336,  98.0205, 114.3899,  60.6710,
96.3505,  96.2472,  82.9648,  96.1724,  65.0242,  89.4360,  72.1828,
129.2011, 131.0616, 108.7055,  91.3205,  61.1262, 101.7852, 121.2087,
107.0247,  79.6827, 109.9638, 101.8867,  73.2457, 129.1673, 132.6519,
98.6721, 132.2162, 109.3977,  88.6744,  85.9168,  94.3893, 105.0213,
78.6196,  96.9139, 132.5845, 115.9961,  64.4721,  87.5260,  87.6323,
109.4375,  97.1924, 119.0398, 126.7783, 103.4364, 106.0800, 120.5252,
74.1415, 112.4055,  84.1586, 117.9896,  85.7219, 117.5077, 117.8901,
79.2466,  81.1814, 118.1241,  93.1923, 123.6255, 111.0393, 102.5209,
86.9959, 114.2165, 110.0702,  93.2411, 131.9605,  99.7534, 131.4412,
143.8335,  81.7567, 107.4799,  76.3925, 101.0644, 124.7404,  98.0265,
69.4643,  88.8145], requires_grad=True), v_leak=tensor(0.), v_th=Parameter containing:
tensor([0.5480, 0.5775, 0.4763, 0.4583, 0.5015, 0.5418, 0.5529, 0.4721, 0.5414,
0.4684, 0.5963, 0.5120, 0.4713, 0.5506, 0.4885, 0.4641, 0.4596, 0.6211,
0.5631, 0.6335, 0.4054, 0.5134, 0.6151, 0.5608, 0.5866, 0.6071, 0.6593,
0.5316, 0.3888, 0.3448, 0.4319, 0.3650, 0.5767, 0.6114, 0.4774, 0.5027,
0.4916, 0.4653, 0.3771, 0.4773, 0.5357, 0.5037, 0.3480, 0.5046, 0.5788,
0.6401, 0.6159, 0.3662, 0.4382, 0.7311, 0.5030, 0.5917, 0.5017, 0.4980,
0.6284, 0.4151, 0.4694, 0.4565, 0.3407, 0.4859, 0.7094, 0.6073, 0.6864,
0.2971, 0.4832, 0.4127, 0.7527, 0.2843, 0.3699, 0.4633, 0.3890, 0.5433,
0.6678, 0.4666, 0.3845, 0.5190, 0.3886, 0.6267, 0.4729, 0.5378, 0.5647,
0.4186, 0.3717, 0.5139, 0.4201, 0.5525, 0.4511, 0.5065, 0.5966, 0.5418,
0.5498, 0.5519, 0.5601, 0.4423, 0.3485, 0.5150, 0.5816, 0.5384, 0.4632,
0.5214], requires_grad=True), v_reset=tensor(0.), method='super', alpha=tensor(100)), autapses=False, dt=0.001
)
)


The inverse membrane time constant and the threshold value now also appears as parameters:

list(m.parameters())

[Parameter containing:
tensor([ 44.2153, 134.8056, 106.5274,  76.2193, 110.3561,  98.9436,  92.4694,
84.5900,  98.2603, 106.6031,  71.4488, 137.1534,  78.1043, 125.3926,
100.4716,  75.9578,  83.7101, 102.5823, 107.7456,  87.9833, 105.4434,
63.4978,  76.7190,  91.1155, 135.7336,  98.0205, 114.3899,  60.6710,
96.3505,  96.2472,  82.9648,  96.1724,  65.0242,  89.4360,  72.1828,
129.2011, 131.0616, 108.7055,  91.3205,  61.1262, 101.7852, 121.2087,
107.0247,  79.6827, 109.9638, 101.8867,  73.2457, 129.1673, 132.6519,
98.6721, 132.2162, 109.3977,  88.6744,  85.9168,  94.3893, 105.0213,
78.6196,  96.9139, 132.5845, 115.9961,  64.4721,  87.5260,  87.6323,
109.4375,  97.1924, 119.0398, 126.7783, 103.4364, 106.0800, 120.5252,
74.1415, 112.4055,  84.1586, 117.9896,  85.7219, 117.5077, 117.8901,
79.2466,  81.1814, 118.1241,  93.1923, 123.6255, 111.0393, 102.5209,
86.9959, 114.2165, 110.0702,  93.2411, 131.9605,  99.7534, 131.4412,
143.8335,  81.7567, 107.4799,  76.3925, 101.0644, 124.7404,  98.0265,
Parameter containing:
tensor([0.5480, 0.5775, 0.4763, 0.4583, 0.5015, 0.5418, 0.5529, 0.4721, 0.5414,
0.4684, 0.5963, 0.5120, 0.4713, 0.5506, 0.4885, 0.4641, 0.4596, 0.6211,
0.5631, 0.6335, 0.4054, 0.5134, 0.6151, 0.5608, 0.5866, 0.6071, 0.6593,
0.5316, 0.3888, 0.3448, 0.4319, 0.3650, 0.5767, 0.6114, 0.4774, 0.5027,
0.4916, 0.4653, 0.3771, 0.4773, 0.5357, 0.5037, 0.3480, 0.5046, 0.5788,
0.6401, 0.6159, 0.3662, 0.4382, 0.7311, 0.5030, 0.5917, 0.5017, 0.4980,
0.6284, 0.4151, 0.4694, 0.4565, 0.3407, 0.4859, 0.7094, 0.6073, 0.6864,
0.2971, 0.4832, 0.4127, 0.7527, 0.2843, 0.3699, 0.4633, 0.3890, 0.5433,
0.6678, 0.4666, 0.3845, 0.5190, 0.3886, 0.6267, 0.4729, 0.5378, 0.5647,
0.4186, 0.3717, 0.5139, 0.4201, 0.5525, 0.4511, 0.5065, 0.5966, 0.5418,
0.5498, 0.5519, 0.5601, 0.4423, 0.3485, 0.5150, 0.5816, 0.5384, 0.4632,
Parameter containing:
tensor([[ 0.1084,  0.0468,  0.2513,  ..., -0.1933, -0.2715, -0.1457],
[-0.1303, -0.1175,  0.1066,  ..., -0.1746, -0.0034, -0.0545],
[ 0.1257,  0.0678, -0.1706,  ...,  0.0328,  0.2516, -0.0167],
...,
[-0.1426,  0.0976, -0.2026,  ..., -0.0921,  0.1836,  0.0779],
[-0.2631, -0.0314,  0.0119,  ...,  0.0307,  0.0070,  0.1155],
[ 0.0787, -0.0943, -0.0187,  ...,  0.0046, -0.0951, -0.2333]],
Parameter containing:
tensor([[ 0.0000,  0.0795,  0.0840,  ...,  0.0226,  0.2035,  0.1445],
[-0.1897,  0.0000, -0.1598,  ..., -0.3020,  0.0549,  0.0066],
[ 0.2601,  0.3069,  0.0000,  ..., -0.1222, -0.2152, -0.0928],
...,
[-0.0862,  0.1007,  0.2161,  ...,  0.0000, -0.1165,  0.1873],
[-0.1242, -0.0897, -0.0713,  ..., -0.2017,  0.0000,  0.0312],
[ 0.1461,  0.0265, -0.0777,  ..., -0.0712,  0.0267,  0.0000]],


## 6.2. Toy Example: Training a small recurrent SNN on MNIST#

In order to demonstrate training on an example task, we turn to MNIST. The training and testing code here is adopted from the training notebook on MNIST and serves as an illustration. We do not necessarily expect there to be a great benefit in optimising the time-constants and threshold in this example.

import torchvision

BATCH_SIZE = 256

transform = torchvision.transforms.Compose(
[
torchvision.transforms.ToTensor(),
torchvision.transforms.Normalize((0.1307,), (0.3081,)),
]
)

train_data = torchvision.datasets.MNIST(
root=".",
train=True,
transform=transform,
)

train_data,
batch_size=BATCH_SIZE,
shuffle=True
)

torchvision.datasets.MNIST(
root=".",
train=False,
transform=transform,
),
batch_size=BATCH_SIZE
)

0.3%

0.7%

1.0%

1.3%

1.7%

2.0%

2.3%

2.6%

3.0%

3.3%

3.6%

4.0%

4.3%

4.6%

5.0%

5.3%

5.6%

6.0%

6.3%

6.6%

6.9%

7.3%

7.6%

7.9%

8.3%

8.6%

8.9%

9.3%

9.6%

9.9%

10.2%

10.6%

10.9%

11.2%

11.6%

11.9%

12.2%

12.6%

12.9%

13.2%

13.6%

13.9%

14.2%

14.5%

14.9%

15.2%

15.5%

15.9%

16.2%

16.5%

16.9%

17.2%

17.5%

17.9%

18.2%

18.5%

18.8%

19.2%

19.5%

19.8%

20.2%

20.5%

20.8%

21.2%

21.5%

21.8%

22.1%

22.5%

22.8%

23.1%

23.5%

23.8%

24.1%

24.5%

24.8%

25.1%

25.5%

25.8%

26.1%

26.4%

26.8%

27.1%

27.4%

27.8%

28.1%

28.4%

28.8%

Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz

29.1%

29.4%

29.8%

30.1%

30.4%

30.7%

31.1%

31.4%

31.7%

32.1%

32.4%

32.7%

33.1%

33.4%

33.7%

34.0%

34.4%

34.7%

35.0%

35.4%

35.7%

36.0%

36.4%

36.7%

37.0%

37.4%

37.7%

38.0%

38.3%

38.7%

39.0%

39.3%

39.7%

40.0%

40.3%

40.7%

41.0%

41.3%

41.7%

42.0%

42.3%

42.6%

43.0%

43.3%

43.6%

44.0%

44.3%

44.6%

45.0%

45.3%

45.6%

45.9%

46.3%

46.6%

46.9%

47.3%

47.6%

47.9%

48.3%

48.6%

48.9%

49.3%

49.6%

49.9%

50.2%

50.6%

50.9%

51.2%

51.6%

51.9%

52.2%

52.6%

52.9%

53.2%

53.6%

53.9%

54.2%

54.5%

54.9%

55.2%

55.5%

55.9%

56.2%

56.5%

56.9%

57.2%

57.5%

57.9%

58.2%

58.5%

58.8%

59.2%

59.5%

59.8%

60.2%

60.5%

60.8%

61.2%

61.5%

61.8%

62.1%

62.5%

62.8%

63.1%

63.5%

63.8%

64.1%

64.5%

64.8%

65.1%

65.5%

65.8%

66.1%

66.4%

66.8%

67.1%

67.4%

67.8%

68.1%

68.4%

68.8%

69.1%

69.4%

69.8%

70.1%

70.4%

70.7%

71.1%

71.4%

71.7%

72.1%

72.4%

72.7%

73.1%

73.4%

73.7%

74.0%

74.4%

74.7%

75.0%

75.4%

75.7%

76.0%

76.4%

76.7%

77.0%

77.4%

77.7%

78.0%

78.3%

78.7%

79.0%

79.3%

79.7%

80.0%

80.3%

80.7%

81.0%

81.3%

81.7%

82.0%

82.3%

82.6%

83.0%

83.3%

83.6%

84.0%

84.3%

84.6%

85.0%

85.3%

85.6%

85.9%

86.3%

86.6%

86.9%

87.3%

87.6%

87.9%

88.3%

88.6%

88.9%

89.3%

89.6%

89.9%

90.2%

90.6%

90.9%

91.2%

91.6%

91.9%

92.2%

92.6%

92.9%

93.2%

93.6%

93.9%

94.2%

94.5%

94.9%

95.2%

95.5%

95.9%

96.2%

96.5%

96.9%

97.2%

97.5%

97.9%

98.2%

98.5%

98.8%

99.2%

99.5%

99.8%

100.0%



Extracting ./MNIST/raw/train-images-idx3-ubyte.gz to ./MNIST/raw

100.0%

Downloading http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz
Extracting ./MNIST/raw/train-labels-idx1-ubyte.gz to ./MNIST/raw


2.0%

4.0%

6.0%

7.9%

9.9%

11.9%

13.9%

15.9%

17.9%

19.9%

21.9%

23.8%

25.8%

27.8%

29.8%

31.8%

33.8%

35.8%

37.8%

39.7%

41.7%

43.7%

45.7%

47.7%

49.7%

51.7%

53.7%

55.6%

57.6%

59.6%

61.6%

63.6%

65.6%

67.6%

69.6%

71.5%

73.5%

75.5%

77.5%

79.5%

81.5%

83.5%

85.5%

87.4%

89.4%

91.4%

93.4%

95.4%

97.4%

99.4%

100.0%



Downloading http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz to ./MNIST/raw/t10k-images-idx3-ubyte.gz
Extracting ./MNIST/raw/t10k-images-idx3-ubyte.gz to ./MNIST/raw


100.0%



Extracting ./MNIST/raw/t10k-labels-idx1-ubyte.gz to ./MNIST/raw


### 6.2.2. Model Defitinition#

For simplicity we are considering a simple network with a single hidden layer of recurrently connected neurons.

from norse.torch import LICell

class SNN(torch.nn.Module):
def __init__(self,
input_features,
hidden_features,
output_features,
recurrent_cell
):
super(SNN, self).__init__()
self.cell = recurrent_cell
self.fc_out = torch.nn.Linear(hidden_features, output_features, bias=False)
self.out = LICell()
self.input_features = input_features

def forward(self, x):
seq_length, batch_size, _, _, _ = x.shape
s1 = so = None
voltages = []

for ts in range(seq_length):
z = x[ts, :, :, :].view(-1, self.input_features)
z, s1 = self.cell(z, s1)
z = self.fc_out(z)
vo, so = self.out(z, so)
voltages += [vo]


class Model(torch.nn.Module):
def __init__(self, encoder, snn, decoder):
super(Model, self).__init__()
self.encoder = encoder
self.snn = snn
self.decoder = decoder

def forward(self, x):
x = self.encoder(x)
x = self.snn(x)
log_p_y = self.decoder(x)
return log_p_y


### 6.2.3. Training and Test loop#

Both the training and test loop are independent of the model or dataset that we are using, in practice you should however probably use a more sophisticated version as they don’t take care of parameter checkpoints or other concerns.

from tqdm.notebook import tqdm, trange

def train(model, device, train_loader, optimizer, epoch, max_epochs):
model.train()
losses = []

for (data, target) in tqdm(train_loader, leave=False):
data, target = data.to(device), target.to(device)
output = model(data)
loss = torch.nn.functional.nll_loss(output, target)
loss.backward()
optimizer.step()
losses.append(loss.item())

mean_loss = np.mean(losses)
return losses, mean_loss

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[11], line 1
----> 1 from tqdm.notebook import tqdm, trange
3 def train(model, device, train_loader, optimizer, epoch, max_epochs):
4     model.train()

ModuleNotFoundError: No module named 'tqdm'

def test(model, device, test_loader, epoch):
model.eval()
test_loss = 0
correct = 0
data, target = data.to(device), target.to(device)
output = model(data)
test_loss += torch.nn.functional.nll_loss(
output, target, reduction="sum"
).item()  # sum up batch loss
pred = output.argmax(
dim=1, keepdim=True
)  # get the index of the max log-probability
correct += pred.eq(target.view_as(pred)).sum().item()

accuracy = 100.0 * correct / len(test_loader.dataset)

return test_loss, accuracy

from norse.torch import ConstantCurrentLIFEncoder

def decode(x):
x, _ = torch.max(x, 0)
log_p_y = torch.nn.functional.log_softmax(x, dim=1)
return log_p_y

T = 32
LR = 0.002
INPUT_FEATURES = 28*28
HIDDEN_FEATURES = 100
OUTPUT_FEATURES = 10
EPOCHS = 5

if torch.cuda.is_available():
DEVICE = torch.device("cuda")
else:
DEVICE = torch.device("cpu")

def run_training(model, optimizer, epochs = EPOCHS):
training_losses = []
mean_losses = []
test_losses = []
accuracies = []

for epoch in trange(epochs):
training_loss, mean_loss = train(model, DEVICE, train_loader, optimizer, epoch, max_epochs=EPOCHS)
test_loss, accuracy = test(model, DEVICE, test_loader, epoch)
training_losses += training_loss
mean_losses.append(mean_loss)
test_losses.append(test_loss)
accuracies.append(accuracy)

print(f"final accuracy: {accuracies[-1]}")
return model


### 6.2.4. Model Evaluation#

With all of this boilerplate out of the way we can define our final model and run training for a number of epochs (10 by default). If you are impatient you can decrease that number to 1-2. With the default values, the result will be a test accuracy of >95%, that is nothing to write home about.

model = Model(
encoder=ConstantCurrentLIFEncoder(
seq_length=T,
),
snn=SNN(
input_features=INPUT_FEATURES,
hidden_features=HIDDEN_FEATURES,
output_features=OUTPUT_FEATURES,
recurrent_cell=ParametrizedLIFRecurrentCell(
input_size=28*28,
hidden_size=100
)
),
decoder=decode
).to(DEVICE)


tau_mem_inv_before = model.snn.cell.cell.p.tau_mem_inv.cpu().detach().numpy()
v_th_before = model.snn.cell.cell.p.v_th.cpu().detach().numpy()

model_after = run_training(model, optimizer, epochs=10)

final accuracy: 95.94

tau_mem_inv_after = model_after.snn.cell.cell.p.tau_mem_inv.cpu().detach().numpy()
v_th_after = model_after.snn.cell.cell.p.v_th.cpu().detach().numpy()


We can plot the distribution of inverse membrane timeconstants before and after the training:

counts, bins = np.histogram(tau_mem_inv_before)
fig, ax = plt.subplots(figsize=(9,5))
ax.hist(bins[:-1], bins, weights=counts, histtype='step', label='before')
counts, bins = np.histogram(tau_mem_inv_after)
ax.hist(bins[:-1], bins, weights=counts, histtype='step', label='after')
ax.set_xlabel('$\\tau_{m}^{-1}$ [ms]')
ax.legend()

<matplotlib.legend.Legend at 0x7fe665b8efd0>


Similarly we can plot the distribution of membrane threshold voltages before and after optimisation:

counts, bins = np.histogram(v_th_before)
fig, ax = plt.subplots(figsize=(9,5))
ax.hist(bins[:-1], bins, weights=counts, histtype='step', label='before')
counts, bins = np.histogram(v_th_after)
ax.hist(bins[:-1], bins, weights=counts, histtype='step', label='after')
ax.set_xlabel('$v_{th}$ [a.u.]')
ax.legend()

<matplotlib.legend.Legend at 0x7fe665b8a8e0>


## 6.3. Conclusions#

This concludes this tutorial, as we have seen incorporating neuron parameters into the optimisation in Norse mainly requires knowledge of the PyTorch internals. At the moment that optimisation is also only supported for the surrogate gradient implementation and not while using the discretised adjoint implementation. This is not a fundamental limitation though and support for neuron parameter gradients could be added.

Several publications have recently explored optimising neuron parameters to both demonstrate that the resulting time constant distributions more closely resembled ones measured in biological cells and advantages in ML applications. As always the challenge to practically demonstrating the advantage of incorporating neuron parameters into the optimisation is doing careful and controlled experiments and choosing the right tasks. While this notebook demonstrates the general technique it does take some shortcuts:

• Optimisation works best if the scale of the values to be optimised is in an appropriate range. This is not the case here for the inverse time constant, which has a value of > 100. A more sophisticated approach would take this into account by for example generating this parameter from an appropriately scaled initial value.

• Similarly we have chosen a rather naive initialisation of both the threshold and inverse membrane time constant. More careful initialisation would for example involve sampling from a distribution with guaranteed positive samples.

• Finally we haven’t demonstrated any benefit of jointly optimising neuron parameters and synaptic weights.