diff --git a/.envrc b/.envrc new file mode 100644 index 00000000..be81fedd --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +eval "$(lorri direnv)" \ No newline at end of file diff --git a/content/presentations/temporal-coding-comsa.md b/content/presentations/temporal-coding-comsa.md deleted file mode 100644 index 1691091d..00000000 --- a/content/presentations/temporal-coding-comsa.md +++ /dev/null @@ -1,367 +0,0 @@ -+++ -title = "Temporal Coding in Spiking Neural Networks with Alpha Synaptic Function (Review)" -author = ["Jethro Kuan"] -lastmod = 2019-09-03T08:29:02+08:00 -draft = false -math = true -+++ - - -
-
- -
Table of Contents
- -- 1 [Introduction](#introduction) - - 1.1 [What are Spiking Neural Networks?](#what-are-spiking-neural-networks) - - 1.2 [Spike Response Model (SRM) cite:gerstner2002spiking](#spike-response-model--srm) - - 1.3 [Spiking, illustrated](#spiking-illustrated) - - 1.4 [Spike Trains](#spike-trains) - - 1.5 [How Do Neurons Encode Information?](#how-do-neurons-encode-information) - - 1.6 [What's the landscape for SNNs?](#what-s-the-landscape-for-snns) -- 2 [Temporal Coding using with Alpha Synaptic Function cite:comsa19\_tempor\_codin\_spikin\_neural\_networ](#temporal-coding-using-with-alpha-synaptic-function) - - 2.1 [Motivation](#motivation) - - 2.2 [Key Ideas](#key-ideas) - - 2.3 [The Coding Scheme](#the-coding-scheme) - - 2.4 [Alpha Synaptic Function](#alpha-synaptic-function) - - 2.5 [Modelling Membrane Potential](#modelling-membrane-potential) - - 2.6 [Solving for the Equation label:eqn:threshold](#solving-for-the-equation) - - 2.7 [The Loss Function](#the-loss-function) - - 2.8 [Synchronization Pulses](#synchronization-pulses) - - 2.9 [Hyperparameters](#hyperparameters) -- 3 [Experiments](#experiments) - - 3.1 [Boolean Logic Problems](#boolean-logic-problems) - - 3.2 [Non-convolutional MNIST](#non-convolutional-mnist) -- 4 [Running the Code](#running-the-code) - - 4.1 [Training the Model](#training-the-model) - - 4.2 [Testing the Models](#testing-the-models) -- 5 [Thoughts](#thoughts) - - 5.1 [My Thoughts](#my-thoughts) -- 6 [Bibliography](#bibliography) - - 6.1 [References](#references) - -
- - - - -## 1 Introduction {#introduction} - - -### 1.1 What are Spiking Neural Networks? {#what-are-spiking-neural-networks} - -- NN architectures that mimics biological neural networks: - - [SNN computes with asynchronous spikes that signal the occurrence - of a characteristic event](https://www.youtube.com/watch?v=3JQ3hYko51Y&feature=youtu.be) - -**Motivation:** - -- low power consumption -- analog computation -- fast inference -- event-driven processing -- online learning -- parallelism - - -### 1.2 Spike Response Model (SRM) (Gerstner \& Kistler, 2002) {#spike-response-model--srm} - -Model for membrane potential: - -\begin{equation} - u\_i(t) = \eta (t - \hat{t\_i}) + \sum\_{j}\sum\_{f} \epsilon\_{ij}(t - t\_j^{(f)}) + u\_{rest} -\end{equation} - -- Spikes come from the dendrites (input neurons), and this voltage accumulates -- Voltage decays slowly to resting potential -- Upon exceeding threshold, spike, and enter refractory period - - -### 1.3 Spiking, illustrated {#spiking-illustrated} - -{{< figure src="/ox-hugo/4-Figure3-1_2019-08-29_12-43-41.png" caption="Figure 1: Membrane potential over time. Source: (Murilo Saraiva de Queiroz et al., 2006)" >}} - - -### 1.4 Spike Trains {#spike-trains} - -- Sequence of `(spike, timestamp)` - -{{< figure src="/ox-hugo/QJQvo_2019-08-29_12-48-37.jpg" caption="Figure 2: Spike Trains for 3 neurons" >}} - - -### 1.5 How Do Neurons Encode Information? {#how-do-neurons-encode-information} - -1. Rate-coding - - - Windowed average across: - - single neuron - - multiple runs - - population of neurons - - **Problems:** - - - Windowed average \\(\rightarrow\\) minimum latency (brain has to wait for average) - - Research shows brain can act on single spikes - -2. Temporal-coding - - - Time to first spike - - Phase - - Correlations and Synchrony - -3. Which coding scheme is better? - - - Both codes are consistent: if the mean firing rate of a neuron is - high, then the time to first spike is expected to occur early - - Rate codes discard temporal information - - For more information see (Gerstner \& Kistler, 2002) - - -### 1.6 What's the landscape for SNNs? {#what-s-the-landscape-for-snns} - -- Pretty bad. -- Most SNNs cannot be trained with gradient-based methods, because - there are no gradients -- The current approach to training SNNs include: - - Binarization of ANNs - - Conversion from ANNs - - Training of constrained networks - - Supervised learning with spikes - - Local learning rules at synapses -- Exception: probabilistic SNNs define outputs as jointly distributed - random binary processes. The joint distributions are differentiable - in the synaptic weights, and one can use principled learning - criteria from ML and information theory - - -## 2 Temporal Coding using with Alpha Synaptic Function (Comsa et al., 2019) {#temporal-coding-using-with-alpha-synaptic-function} - - -### 2.1 Motivation {#motivation} - -1. Atemporal networks (think LSTMs) don't have the benefits of - encoding information directly in the temporal domain - 1. They remain sequential (require all previous layers of - computation to produce answer) - 2. Information in the real world are typically temporal - - -### 2.2 Key Ideas {#key-ideas} - -1. **Temporal Coding**: Information is encoded in the relative timing of - neuron spikes. Using temporal coding allows shift of differentiable - relationship into the temporal domain. - 1. Find differentiable relationship of the time of postsynaptic - spike with respect to the weights and times of the presynaptic - spikes. - -2. **Alpha synaptic transfer function**: Use the SRM, but with the - exponential decay of form \\(t e^{-t}\\). - -3. **Synchronization pulses:** input-independent spikes, used to - facilitate transformations of the class boundaries. - - -### 2.3 The Coding Scheme {#the-coding-scheme} - -More salient information about a feature is encode as an earlier -spike in the corresponding input neuron (think time-to-first-spike). - -In a classification problem with \\(m\\) inputs and \\(n\\) possible classes: - -input -: spike times of \\(m\\) input neurons - -output -: index of output neuron that fires first (among the \\(n\\) - output neurons) - - -### 2.4 Alpha Synaptic Function {#alpha-synaptic-function} - -Incoming exponential synaptic kernels are of the form \\(\epsilon(t) = -\tau^{-1}e^{-\tau t}\\) for some decay constant \\(\tau\\). Potential of -membrane in response to the spike is then \\(u(t) = t e^{-\tau t}\\). It -has a gradual rise, and slow decay. - -{{< figure src="/ox-hugo/screenshot_2019-08-30_13-21-44.png" caption="Figure 3: Plot of \\(y = x e^{-10x}, x \in [0, 1]\\)" >}} - - -### 2.5 Modelling Membrane Potential {#modelling-membrane-potential} - -The membrane potential is a weighted sum of the presynaptic inputs: - -\begin{equation} - V\_{mem}(t) = \sum\_{i} w\_i (t-t\_i)e^{\tau(t\_i - t)} -\end{equation} - -We can compute the spike time \\(t\_{out}\\) of a neuron by considering the -minimal subset of presynaptic inputs \\(I\_{t\_{out}}\\) with \\(t\_i \le -t\_{out}\\) such that: - -\begin{equation} \label{eqn:threshold} - \sum\_{i \in {I\_{t\_{out}}}} w\_i \left( t\_{out} - t\_{i} \right) - e^{\tau (t\_i - t\_{out})} = \theta -\end{equation} - - has 2 solutions: 1 on rising part of function and -another on decaying part. The spike time is the earlier solution. - - -### 2.6 Solving for the Equation {#solving-for-the-equation} - -Let \\(A\_{I} = \sum\_{i \in I} w\_i e^{\tau t\_i}\\), and \\(B\_{I} = \sum\_{i -\in I} w\_i e^{\tau t\_i} t\_i\\), we can compute: - -\begin{equation} - t\_{out} = \frac{B\_I}{A\_I} - \frac{1}{\tau}W\left( -\tau - \frac{\theta}{A\_I}e^{\tau \frac{B\_I}{A\_I}} \right) -\end{equation} - -where \\(W\\) is the [Lambert W function](https://en.wikipedia.org/wiki/Lambert%5FW%5Ffunction). - - -### 2.7 The Loss Function {#the-loss-function} - -The loss minimizes the spike time of the target neuron, and maximizes -the spike time of non-target neurons (cross-entropy!) - -Softmax on the negative values of the spike times \\(o\_{i}\\) (which -are always positive): - -\begin{equation} - p\_j = \frac{e^{- o\_j}}{\sum\_{i=1}^{n} e^{- o\_i}} -\end{equation} - -The cross entropy loss \\(L(y\_i, p\_i) = - \sum\_{i=1}^{n} y\_i \ln p\_i\\) is -used. - -Changing the weights of the network alters the spike times. We can -compute the exact derivative of the post synaptic spike time wrt any -presynaptic spike time \\(t\_j\\) and its weight \\(w\_j\\) as: - -\begin{equation} - \frac{\partial t\_{out}}{\partial t\_j} = \frac{w\_j e^{t\_j} \left( t\_j - - \frac{B\_I}{A\_I} + W\_I + 1\right)}{A\_I (1 + W\_I)} -\end{equation} - -\begin{equation} - \frac{\partial t\_{out}}{\partial w\_j} = \frac{e^{t\_j} \left( t\_j - - \frac{B\_I}{A\_I} + W\_I + 1\right)}{A\_I (1 + W\_I)} -\end{equation} - -where - -\begin{equation} - W\_I = W\left( -\frac{\theta}{A\_I}e^{\frac{B\_I}{A\_I}} \right) -\end{equation} - - -### 2.8 Synchronization Pulses {#synchronization-pulses} - -These act as a temporal form of bias, adjusting class boundaries in -the temporal domain. Per network, or per layer biases are added. Spike -times for each pulse are learned with the rest of the parameters of -the network. - - -### 2.9 Hyperparameters {#hyperparameters} - -{{< figure src="/ox-hugo/screenshot_2019-08-30_13-52-12.png" >}} - - -## 3 Experiments {#experiments} - - -### 3.1 Boolean Logic Problems {#boolean-logic-problems} - -Inputs encoded as individual spike times of two input neurons. All -spikes occur between 0 and 1. True and False values are drawn from -distributions \\([0.0, 0.45]\\) and \\([0.55, 1.0]\\) respectively. - -Trained for maximum of 100 epochs, 1000 training examples. Tested on -150 randomly generated test examples. 100% accuracy on all problems. - - -### 3.2 Non-convolutional MNIST {#non-convolutional-mnist} - -784 neurons of the input layer corresponding to pixels of the image. -Darker pixels encoded as earlier spike times. Output of network is the -index of the earliest neuron to spike. - -Trained with evolutionary-neural hybrid agents. Best networks achieved -99.96% and 97.96% accuracy on train and test sets. - -The network learns two operating modes: slow-regime and fast-regime. -Operating in the slow regime has higher accuracy, but takes more time. -Fast regime makes quick decisions, with the first spike in the output -layer occurring before the mean spike in the hidden layer. - -{{< figure src="/ox-hugo/screenshot_2019-08-30_14-05-59.png" >}} - - -## 4 Running the [Code](https://github.com/google/ihmehimmeli/) {#running-the-code} - - -### 4.1 Training the Model {#training-the-model} - -```text -Ignoring n_inputs flag for MNIST problem. Using 784 inputs. -Network architecture: [784, 340, 10] -Sync pulses: [0.0909091, 0.181818, 0.272727, 0.363636, 0.454545, 0.545455, 0.636364, 0.727273, 0.818182, 0.909091] -Saving the model that performs best on validation set. -Loading MNIST data... -Done loading MNIST data. -Loading MNIST data... -Done loading MNIST data. -Using ThreadPool with 16 threads. - -run 0 epoch 0 train_error 0.97 train_acc.% 68.668519 valid acc.% 82.916664 elapsed 52207ms Sync pulses: [[8.076, 8.23419, 0.189354, 0.338183, 8.56173, 1.18753, 0.407155, 9.37003, 1.0993, 9.06061], [9.09816, 2.53959, 9.10911, 9.25221, 0.243072, 9.12975, 8.56196, 4.01023, 9.1322, 5.54389], [0.0909091, 0.181818, 0.272727, 0.363636, 0.454545, 0.545455, 0.636364, 0.727273, 0.818182, 0.909091]] LR: 0.00101864 batch sz: 32 - -run 0 epoch 1 train_error 0.38 train_acc.% 88.842593 valid acc.% 89.650002 elapsed 52526ms Sync pulses: [[8.92665, 9.10365, 0, 0, 9.08495, 0, 2.74874, 10.427, 6.27137, 10.0179], [9.87262, 4.53841, 9.00944, 10], [0.0909091, 0.181818, 0.272727, 0.363636, 0.454545, 0.545455, 0.636364, 0.727273, 0.818182, 0.909091]] LR: 0.00101864 batch sz: 32 - -run 0 epoch 2 train_error 0.29 train_acc.% 91.561111 valid acc.% 91.733330 elapsed 52074ms Sync pulses: [[10.1715, 9.89629, 0.0372902, 0.0709029, 10.825, 0.105749, 3.72036, 11.2825, 7.87501, 11.2333], [10.3181, 5.71146, 10.3364, 11.5131, 2.54343, 11.4791, 10.4386, 3.77724, 11.4736, 8.09482], [0.0909091, 0.181818, 0.272727, 0.363636, 0.454545, 0.545455, 0.636364, 0.727273, 0.818182, 0.909091]] LR: 0.00101864 batch sz: 32 -``` - - -### 4.2 Testing the Models {#testing-the-models} - -```text -[nix-shell:~/projects/ihmehimmeli/build]$ tempcoding/tempcoding_main -model_to_test=tempcoding/networks/slow_network -problem=mnist -n_test=10000 -n_train=60000 -n_validation=0 -decay_rate=0.181769 -mnist_data_path=../data/mnist -W2019-09-01T21:48:01.040269665+08:00 /home/jethro/projects/ihmehimmeli/tempcoding/spiking_problem.cc:417] Ignoring n_inputs flag for MNIST problem. Using 784 inputs. - IHM_CHECK(file.Open(path, mode)) failed at /home/jethro/projects/ihmehimmeli/tempcoding/file_passthrough_external.cc:97 - Aborted -``` - - -## 5 Thoughts {#thoughts} - - -### 5.1 My Thoughts {#my-thoughts} - -Little information is lost with the temporal encoding scheme, so I'd -expect the spiking neural network to perform well. Especially so, -since there are gradients and gradient-based methods have already -proven to be reliable. - -Will augmenting gradients for a spiking neural network be useful in -this scenario? Can we meta-learn for algorithms like STDP or -equilibrium propagation instead? - - -## 6 Bibliography {#bibliography} - - -### 6.1 References {#references} - - -# Bibliography -Gerstner, W., & Kistler, W. M., *Spiking neuron models: single neurons, populations, plasticity* (2002), : Cambridge university press. [↩](#fb7c0ce207bba24abc5543768d7e694d) - -Queiroz, M. S. d., Berrêdo, R. C. d., & Antônio de P\'adua Braga, *Reinforcement learning of a simple control task using the spike response model*, Neurocomputing, *70(1-3)*, 14–20 (2006). http://dx.doi.org/10.1016/j.neucom.2006.07.002 [↩](#c6103ec10de5867ca179830c28dcf19d) - -Comsa, I. M., Potempa, K., Versari, L., Fischbacher, T., Gesmundo, A., & Alakuijala, J., *Temporal coding in spiking neural networks with alpha synaptic function*, CoRR, *()*, (2019). [↩](#caaddec51f6948e5fea79b6d41c79676) diff --git a/content/talks/emti_dl_with_bayesian_principles.md b/content/talks/emti_dl_with_bayesian_principles.md index 0528a5fd..19333314 100644 --- a/content/talks/emti_dl_with_bayesian_principles.md +++ b/content/talks/emti_dl_with_bayesian_principles.md @@ -1,7 +1,7 @@ +++ title = "Deep Learning With Bayesian Principles - Emtiyaz Khan" author = ["Jethro Kuan"] -lastmod = 2020-02-10T17:00:12+08:00 +lastmod = 2020-02-10T22:07:04+08:00 draft = false +++ @@ -90,7 +90,7 @@ approximation \\(q\\), and giving away the global property of the rule. ### Deriving Gradient Descent {#deriving-gradient-descent} Gradient descent is derived from using a Gaussian with fixed -covariance, and approximating $E\_q[l(θ)] ≈ l(m).$ +covariance, and approximating \\(E\_q[l(\theta)] \approx l(m)\\). ## Resources {#resources} diff --git a/content/zettels/docker.md b/content/zettels/docker.md index 8e51ce19..ec0206f2 100644 --- a/content/zettels/docker.md +++ b/content/zettels/docker.md @@ -1,12 +1,12 @@ +++ title = "Docker 101" author = ["Jethro Kuan"] -lastmod = 2020-02-06T12:25:22+08:00 +lastmod = 2020-02-10T21:15:10+08:00 draft = false +++ tags -: [§linux]({{< relref "linux" >}}), [§operating\_systems]({{< relref "operating_systems" >}}) +: [Linux]({{< relref "linux" >}}), [Operating Systems]({{< relref "operating_systems" >}}) ## Why Containers {#why-containers} diff --git a/content/zettels/gcc.md b/content/zettels/gcc.md index fb622dea..c38addb8 100644 --- a/content/zettels/gcc.md +++ b/content/zettels/gcc.md @@ -1,12 +1,12 @@ +++ title = "GCC" author = ["Jethro Kuan"] -lastmod = 2020-02-06T12:40:13+08:00 +lastmod = 2020-02-10T21:14:57+08:00 draft = false +++ tags -: [§compilers]({{< relref "compilers" >}}), [§cplusplus]({{< relref "cplusplus" >}}), [§c\_lang]({{< relref "c_lang" >}}) +: [Compilers]({{< relref "compilers" >}}), [The C Language]({{< relref "c_lang" >}}) ## Building GCC {#building-gcc} diff --git a/content/zettels/spiking_neurons.md b/content/zettels/spiking_neurons.md deleted file mode 100644 index f421295f..00000000 --- a/content/zettels/spiking_neurons.md +++ /dev/null @@ -1,1231 +0,0 @@ -+++ -title = "Spiking Neurons" -author = ["Jethro Kuan"] -lastmod = 2019-11-21T18:37:06+08:00 -draft = false -math = true -+++ - -## Introduction to Spiking Neural Networks {#introduction-to-spiking-neural-networks} - -While the project is equal part reinforcement learning and spiking -neural networks, reinforcement learning is a popular field and has -been extensively covered by researchers worldwide -(Ivanov \& D'yakonov, 2019), (Li, 2018). -Hence, I have chosen instead to review the literature around spiking -neural networks. - - -### The Generations of Neural Networks {#the-generations-of-neural-networks} - -Neural network models can be classified into three generations, -according to their computational units: perceptrons, non-linear -units, and spiking neurons ("Wolfgang Maass", 1997). - -Perceptrons can be composed to produce a variety of models, including -Boltzmann machines and Hopfield networks. Non-linear units are -currently the most widely used computational unit, responsible for the -explosion of progress in machine learning research, in particular, the -success of deep learning. These units traditionally apply -differentiable, non-linear activation functions such across a weighted -sum of input values. - -There are two reasons second-generation computational units have seen -so much success. First, the computational power of these units is -greater than that of first-generation neural networks. Networks built -with second-generation computational units with one hidden layer are -universal approximators for any continuous function with a compact -domain and range ("Cybenko, 1989). Second, networks built with these -units are trainable with well-researched gradient-based methods, such -as backpropagation. - -The third generation of neural networks use computational units called -spiking neurons. Much like our biological neurons, spiking neurons are -connected to each other at synapses, receiving incoming signals at the -dendrites and sending spikes to other neurons via the axon. Each -computational unit stores some state: in particular, it stores its -membrane potential at any point in time. Rather than fire at each -propagation cycle, these computational units fire only when their -individual membrane potentials crosses its firing threshold. A simple -spiking neuron model is given in . - -From this section onwards, we shall term second-generation neural -networks Artificial Neural Networks (ANNs), and third-generation -neural networks Spiking Neural Networks (SNNs). - - -### A Spiking Neuron Model {#a-spiking-neuron-model} - -In spiking neural networks, neurons exchange information via spikes, -and the information received depends on: - -Firing frequencies -: The relative timing of pre and post-synaptic - spikes, and neuronal firing patterns - -Identity of synapses used -: Which neurons are connected, whether their - synapses are inhibitory or excitatory, and synaptic strength - -Each neuron has a corresponding model that encapsulates its state: the -current membrane potential. As with the mammalian brain, incoming -spikes increase the value of membrane potential. The membrane -potential eventually decays to resting potential in the absence of -spikes. These dynamics are often captured via first-order differential -equations. Here we define the Spike Response Model (SRM), a simple but -widely-used model describing the momentary value of a neuron \\(i\\). - -We define for presynaptic neuron \\(j\\), \\(\epsilon\_{ij}(t) = u\_{i}(t) - -u\_{\text{rest}}\\). For a few input spikes, the membrane potential responds -roughly linearly to the input spikes: - -\begin{equation} -u\_i{t} = \sum\_{j}\sum\_{f} \epsilon\_{ij}(t - t\_j^{(f)}) + u\_{\text{rest}} -\end{equation} - -SRM describes the membrane potential of neuron \\(i\\) as: - -\begin{equation} -u\_i{t} = \eta (t - \hat{t\_i}) + \sum\_{j}\sum\_{f} \epsilon\_{ij}(t - t\_j^{(f)}) + u\_{\text{rest}} -\end{equation} - -where \\(\hat{t\_i}\\) is the last firing time of neuron \\(i\\). - -We refer to moment when a given neuron emits an action potential as -the firing time of that neuron. We denote the firing times of neuron -\\(i\\) by \\(t\_i^{(f)}\\) where \\(f = 1,2,\dots\\) is the label of the spike. -Then we formally denote the spike train of a neuron \\(i\\) as the -sequence of firing times: - -\begin{equation} - S\_i(t) = \sum\_{f} \delta\left( t - t\_i^{(f)} \right) -\end{equation} - -where \\(\delta(x)\\) is the Dirac-delta function with \\(\delta(x) = 0\\) -for \\(x \ne 0\\) and \\(\int\_{-\infty}^{\infty} \delta(x)dx = 1\\). Spikes -are thus reduced to points in time. - - -### Motivating Spiking Neural Networks {#motivating-spiking-neural-networks} - -Since second-generation neural networks have excellent performance, -why bother with spiking neural networks? In this section, we motivate -spiking neural networks from various perspectives. - -- Information Encoding - - To directly compare ANNs and SNNs, one can consider the real-valued - outputs of ANNs to be the firing rate of a spiking neuron in steady - state. In fact, such rate coding has been used to explain - computational processes in the brain (Pfeiffer \& Pfeil, 2018). Spiking - neuron models encode information beyond the average firing rate: these - models also utilize the relative timing between spikes - (Robert G\"utig, 2014), or spike phases (in-phase or - out-of-phase). These time-dependent codes are termed temporal codes, - and play an important role in biology. First, research has shown that - different actions are taken based on single spikes - (Martin Stemmler, 1996). Second, relying on the average firing rate - would greatly increase the latency of the brain, and our brain often - requires decision-making long before several spikes are accumulated. - It has also been successfully demonstrated that temporal coding - achieves competitive empirical performance on classification tasks for - both generated datasets, as well as image datasets like MNIST and - CIFAR (Comsa et al., 2019). - -- Biological Plausibility - - A faction of the machine learning and neurobiology community strives - for emulation of the biological brain. There are several - incompatibilities between ANNs and the current state of neurobiology - that are not easily reconciliated. - - First, neurons in ANNs communicate via continuous-valued activations. - This is contrary to neurobiological research, which shows that - communication between biological neurons communicate by broadcasting - spike trains: trains of action potentials to downstream neurons. The - spikes are to a first-order approximation of uniform amplitude, unlike - the continuous-valued activations of ANNs. - - Second, backpropagation as a learning procedure also presents - incompatibilities with the biological brain ("Amirhossein Tavanaei et al., 2019). - Consider the chain rule in backpropagation: - - \begin{equation} \label{chainrule} - \delta\_{j}^{\mu}=g^{\prime}\left(a\_{j}^{\mu}\right) \sum\_{k} w\_{k j} \delta\_{k}^{\mu} - \end{equation} - - \\(\delta\_{j}^{\mu}\\) and \\(\delta\_{k}^{\mu}\\) denote the partial - derivatives of the cost function for input pattern \\(\mu\\) with respect - to the net input to some arbitrary unit \\(j\\) or \\(k\\). Unit \\(j\\) projects - feed-forward connections to the set of units indexed by \\(k\\). - \\(g(\cdot)\\) is the activation function applied to the net input of unit - \\(j\\), denoted \\(a\_j^{\mu}\\), \\(w\_{kj}\\) are the feedforward weights - projecting from unit \\(j\\) to the set of units indexed by \\(k\\). - - The chain rule formulation presents two problems. First, the - gradients \\(g'(\cdot)\\) requires derivatives, but \\(g(\cdot)\\) in spiking - neurons is represented by sum of Dirac delta functions, for which - derivatives do not exist. Second, the expression \\(\sum\_{k} w\_{k j} - \delta\_{k}^{\mu}\\) uses feedforward weights in a feedback fashion. This - mean that backpropagation is only possible in the presence of - symmetric feedback weights, but these do not exist in the brain. In - addition, during backpropagation the error assignment for each neuron - is computed using non-local information. - -- Neuromorphic Hardware - - In a traditional Von Neumann architecture, the logic core operates on - data fetched sequentially from memory. In contrast, in neuromorphic - chips both computation and memory are distributed across computational - units that are connected via synapses. The neuronal architecture and - parameters hence play a key role in information representation and - define the computations that are performed. - - It has also been observed that spike-trains in the mammalian brain are - often sparse in time, suggesting that timing and relative timings of - spikes encode large amounts of information. Neuromorphic chips - implement this same sparse, low-precision communication protocol - between neurons on the chip, and by offering the same asynchronous, - event-based parallelism paradigm that the brain uses, are able to - perform certain workloads with much less power than Von Neumann chips. - - These integrated circuits are typically programmed with spiking neural - networks. Examples of such chips include IBM's TrueNorth - (Merolla et al., 2014) and Intel's Loihi (Davies et al., 2018). Because - spiking neural networks have not yet been successfully trained on many - tasks, neuromorphic chips has seen little practical use. These chips - have only recently been successfully used in robotic navigation - ("Tang et al., 2019), and solving graph problems by manual construction of the - network graph ("William Severa et al., 2016). - - -### Training Spiking Neural Networks {#training-spiking-neural-networks} - -As explained in , it is desirable to train spiking -neural networks to perform arbitrary tasks, utilizing power-efficient -neuromorphic chips that break the Von Neumann bottleneck. We classify -the training strategies by their usage of gradients, and discuss -certain optimization techniques. - -- Non-gradient based methods - - Spiking neurons communicate via spikes, hence, unlike ANNs, gradients - are non-existent. In addition, backpropagation is not biologically - plausible (see ). This motivates the use of - plasticity-based methods and evolutionary strategies for training - SNNs. - - One category of learning rules used in SNNs are local learning rules. - These rules include Hebbian learning (neurons that fire together wire - together), and its extension: the spike-timing-dependent-plasticity - rule (STDP). Inspired by experiments in neuroscience, central to these - learning rules is the theme that neuron spike ordering and their - relative timings encode information. STDP adjusts the strength of - connections between neurons using the relative timing of a neuron's - output and its input potentials (hence, spike-timing dependent). - - In machine learning terminology, the weights of the synapses are - adjusted according to fixed rules for each training example. Each - synapse is given a weight \\(0 \le w \le w\_{max}\\) , characterizing its - strength, and its change depends on the exact moments \\(t\_{pre}\\) of - pre-synaptic spikes and \\(t\_{post}\\) of post-synaptic spikes - (Alexander Sboev et al., 2018): - - \begin{equation} - \Delta w=\left\\{\begin{array}{l}{-\alpha \lambda \cdot \exp - \left(-\frac{t\_{\mathrm{pre}}-t\_{\mathrm{post}}}{\tau\_{-}}\right), - \text {if } t\_{\mathrm{pre}}-t\_{\mathrm{post}}>0} - \\ {\lambda \cdot \exp - \left(-\frac{t\_{\mathrm{post}}-t\_{\mathrm{pre}}}{\tau\_{+}}\right), - \text {if } - t\_{\mathrm{pre}}-t\_{\mathrm{post}}<0}\end{array}\right. - \end{equation} - - where \\(\tau\_{+}\\) and \\(\tau\_{-}\\) are time constants. \\(\tau\_{+} = 16.8ms\\) - and \\(\tau\_{-} = 33.7ms\\) are reasonable approximations obtained - experimentally. - - There are several libraries like BindsNET - (Hazan et al., 2018) that simulate SNNs on Von Neumann - computers implementing these rules. Recent attempts have been made to - combine Reinforcement Learning and STDP: both in solving RL problems - (Hazan et al., 2018), and using the reinforcement learning - framework to train SNN - (Bing et al., 2019), (Lee et al., 2018). However, SNNs - trained using the STDP learning rule have yet to achieve comparable - performance compared to ANNs on relatively simple datasets like MNIST - ("Amirhossein Tavanaei et al., 2019). - -- Gradient-based methods - - Performance is important for practical applications, and - gradient-based training methods such as backpropagation has shown - competitive performance. It is thus desirable to train spiking neural - networks with these gradient-based methods. - - There are several problems with spike-compatible gradient-based - methods. First, most of these methods cannot train neurons in the - hidden layers: they can only train neurons at the final layer, that - receive the desired target output pattern - (Robert Urbanczik \& Walter Senn, 2009), (Lee et al., 2016). - Second, the discontinuous, binary nature of spiking output needs to be - addressed. For example, SpikeProp approximates the membrane - threshold function at a local area with a linear function, introducing - gradients and computing the exact formulae for error backpropagation - for synaptic weights and spike times (Bohte et al., 2000). Others have - modified the threshold function with a gate function - @incollection{NIPS2018_7417, - title = {Gradient Descent for Spiking Neural Networks}, - author = {Huh, Dongsung and Sejnowski, Terrence J}, - booktitle = {Advances in Neural Information Processing Systems - 31}, - editor = {S. Bengio and H. Wallach and H. Larochelle and K. - Grauman and N. Cesa-Bianchi and R. Garnett}, - pages = {1433--1443}, - year = 2018, - publisher = {Curran Associates, Inc.}, - url = - {http://papers.nips.cc/paper/7417-gradient-descent-for-spiking-neural-networks.pdf} - }, used the alpha transfer function to derive - gradient update rules (Comsa et al., 2019), - and approximate the dirac-delta spikes with a probability density - function @incollection{NIPS2018_7415, - title = {SLAYER: Spike Layer Error Reassignment in Time}, - author = {Shrestha, Sumit Bam and Orchard, Garrick}, - booktitle = {Advances in Neural Information Processing Systems - 31}, - editor = {S. Bengio and H. Wallach and H. Larochelle and K. - Grauman and N. Cesa-Bianchi and R. Garnett}, - pages = {1412--1421}, - year = 2018, - publisher = {Curran Associates, Inc.}, - url = - {http://papers.nips.cc/paper/7415-slayer-spike-layer-error-reassignment-in-time.pdf} - }. - - Another approach is converting trained ANN models into SNNs - (Rueckauer et al., 2016). Common ANN layers such - as softmax, batch normalization and max-pooling layers have their - corresponding spiking counterparts. - - Equilibrium Propagation was recently proposed to solve the - neurobiological incompatibilities of backpropagation - (Scellier \& Bengio, 2017). Because the gradients are defined only - in terms of local perturbations, the synaptic updates correspond to - the standard form of STDP. The propagated signal encodes the gradients - of a well-defined objective function on energy-based models, where the - goal is to minimize the energy of the model. To resolve the issue of - communication using binary-valued signals, step-size annealing was - used to train spiking neural networks with Equilibrium Propagation - (O'Connor et al., 2019). - -- Future Research Areas - - A nascent area is local learning on neuromorphic chips. Thus far - spiking neural networks are simulated and trained before deployment on - a neuromorphic chip. In Intel's Loihi chip, each core contains a - learning engine that can update synaptic weights using the 4-bit - microcode-programmed learning rules that are associated with that - synapse. This opens up areas for online learning. - - -## The Generations of Neural Networks {#the-generations-of-neural-networks} - -Neural network models can be classified into three generations, -according to their computational units: perceptrons, non-linear -units, and spiking neurons ("Wolfgang Maass", 1997). - -Perceptrons can be composed to produce a variety of models, including -Boltzmann machines and Hopfield networks. Non-linear units are -currently the most widely used computational unit, responsible for the -explosion of progress in machine learning research, in particular, the -success of deep learning. These units traditionally apply -differentiable, non-linear activation functions such across a weighted -sum of input values. - -There are two reasons second-generation computational units have seen -so much success. First, the computational power of these units is -greater than that of first-generation neural networks. Networks built -with second-generation computational units with one hidden layer are -universal approximators for any continuous function with a compact -domain and range ("Cybenko, 1989). Second, networks built with these -units are trainable with well-researched gradient-based methods, such -as backpropagation. - -The third generation of neural networks use computational units called -spiking neurons. Much like our biological neurons, spiking neurons are -connected to each other at synapses, receiving incoming signals at the -dendrites and sending spikes to other neurons via the axon. Each -computational unit stores some state: in particular, it stores its -membrane potential at any point in time. Rather than fire at each -propagation cycle, these computational units fire only when their -individual membrane potentials crosses its firing threshold. A simple -spiking neuron model is given in . - -From this section onwards, we shall term second-generation neural -networks Artificial Neural Networks (ANNs), and third-generation -neural networks Spiking Neural Networks (SNNs). - - -### A Spiking Neuron Model {#a-spiking-neuron-model} - -In spiking neural networks, neurons exchange information via spikes, -and the information received depends on: - -Firing frequencies -: The relative timing of pre and post-synaptic - spikes, and neuronal firing patterns - -Identity of synapses used -: Which neurons are connected, whether their - synapses are inhibitory or excitatory, and synaptic strength - -Each neuron has a corresponding model that encapsulates its state: the -current membrane potential. As with the mammalian brain, incoming -spikes increase the value of membrane potential. The membrane -potential eventually decays to resting potential in the absence of -spikes. These dynamics are often captured via first-order differential -equations. Here we define the Spike Response Model (SRM), a simple but -widely-used model describing the momentary value of a neuron \\(i\\). - -We define for presynaptic neuron \\(j\\), \\(\epsilon\_{ij}(t) = u\_{i}(t) - -u\_{\text{rest}}\\). For a few input spikes, the membrane potential responds -roughly linearly to the input spikes: - -\begin{equation} -u\_i{t} = \sum\_{j}\sum\_{f} \epsilon\_{ij}(t - t\_j^{(f)}) + u\_{\text{rest}} -\end{equation} - -SRM describes the membrane potential of neuron \\(i\\) as: - -\begin{equation} -u\_i{t} = \eta (t - \hat{t\_i}) + \sum\_{j}\sum\_{f} \epsilon\_{ij}(t - t\_j^{(f)}) + u\_{\text{rest}} -\end{equation} - -where \\(\hat{t\_i}\\) is the last firing time of neuron \\(i\\). - -We refer to moment when a given neuron emits an action potential as -the firing time of that neuron. We denote the firing times of neuron -\\(i\\) by \\(t\_i^{(f)}\\) where \\(f = 1,2,\dots\\) is the label of the spike. -Then we formally denote the spike train of a neuron \\(i\\) as the -sequence of firing times: - -\begin{equation} - S\_i(t) = \sum\_{f} \delta\left( t - t\_i^{(f)} \right) -\end{equation} - -where \\(\delta(x)\\) is the Dirac-delta function with \\(\delta(x) = 0\\) -for \\(x \ne 0\\) and \\(\int\_{-\infty}^{\infty} \delta(x)dx = 1\\). Spikes -are thus reduced to points in time. - - -### Motivating Spiking Neural Networks {#motivating-spiking-neural-networks} - -Since second-generation neural networks have excellent performance, -why bother with spiking neural networks? In this section, we motivate -spiking neural networks from various perspectives. - -- Information Encoding - - To directly compare ANNs and SNNs, one can consider the real-valued - outputs of ANNs to be the firing rate of a spiking neuron in steady - state. In fact, such rate coding has been used to explain - computational processes in the brain (Pfeiffer \& Pfeil, 2018). Spiking - neuron models encode information beyond the average firing rate: these - models also utilize the relative timing between spikes - (Robert G\"utig, 2014), or spike phases (in-phase or - out-of-phase). These time-dependent codes are termed temporal codes, - and play an important role in biology. First, research has shown that - different actions are taken based on single spikes - (Martin Stemmler, 1996). Second, relying on the average firing rate - would greatly increase the latency of the brain, and our brain often - requires decision-making long before several spikes are accumulated. - It has also been successfully demonstrated that temporal coding - achieves competitive empirical performance on classification tasks for - both generated datasets, as well as image datasets like MNIST and - CIFAR (Comsa et al., 2019). - -- Biological Plausibility - - A faction of the machine learning and neurobiology community strives - for emulation of the biological brain. There are several - incompatibilities between ANNs and the current state of neurobiology - that are not easily reconciliated. - - First, neurons in ANNs communicate via continuous-valued activations. - This is contrary to neurobiological research, which shows that - communication between biological neurons communicate by broadcasting - spike trains: trains of action potentials to downstream neurons. The - spikes are to a first-order approximation of uniform amplitude, unlike - the continuous-valued activations of ANNs. - - Second, backpropagation as a learning procedure also presents - incompatibilities with the biological brain ("Amirhossein Tavanaei et al., 2019). - Consider the chain rule in backpropagation: - - \begin{equation} \label{chainrule} - \delta\_{j}^{\mu}=g^{\prime}\left(a\_{j}^{\mu}\right) \sum\_{k} w\_{k j} \delta\_{k}^{\mu} - \end{equation} - - \\(\delta\_{j}^{\mu}\\) and \\(\delta\_{k}^{\mu}\\) denote the partial - derivatives of the cost function for input pattern \\(\mu\\) with respect - to the net input to some arbitrary unit \\(j\\) or \\(k\\). Unit \\(j\\) projects - feed-forward connections to the set of units indexed by \\(k\\). - \\(g(\cdot)\\) is the activation function applied to the net input of unit - \\(j\\), denoted \\(a\_j^{\mu}\\), \\(w\_{kj}\\) are the feedforward weights - projecting from unit \\(j\\) to the set of units indexed by \\(k\\). - - The chain rule formulation presents two problems. First, the - gradients \\(g'(\cdot)\\) requires derivatives, but \\(g(\cdot)\\) in spiking - neurons is represented by sum of Dirac delta functions, for which - derivatives do not exist. Second, the expression \\(\sum\_{k} w\_{k j} - \delta\_{k}^{\mu}\\) uses feedforward weights in a feedback fashion. This - mean that backpropagation is only possible in the presence of - symmetric feedback weights, but these do not exist in the brain. In - addition, during backpropagation the error assignment for each neuron - is computed using non-local information. - -- Neuromorphic Hardware - - In a traditional Von Neumann architecture, the logic core operates on - data fetched sequentially from memory. In contrast, in neuromorphic - chips both computation and memory are distributed across computational - units that are connected via synapses. The neuronal architecture and - parameters hence play a key role in information representation and - define the computations that are performed. - - It has also been observed that spike-trains in the mammalian brain are - often sparse in time, suggesting that timing and relative timings of - spikes encode large amounts of information. Neuromorphic chips - implement this same sparse, low-precision communication protocol - between neurons on the chip, and by offering the same asynchronous, - event-based parallelism paradigm that the brain uses, are able to - perform certain workloads with much less power than Von Neumann chips. - - These integrated circuits are typically programmed with spiking neural - networks. Examples of such chips include IBM's TrueNorth - (Merolla et al., 2014) and Intel's Loihi (Davies et al., 2018). Because - spiking neural networks have not yet been successfully trained on many - tasks, neuromorphic chips has seen little practical use. These chips - have only recently been successfully used in robotic navigation - ("Tang et al., 2019), and solving graph problems by manual construction of the - network graph ("William Severa et al., 2016). - - -### Training Spiking Neural Networks {#training-spiking-neural-networks} - -As explained in , it is desirable to train spiking -neural networks to perform arbitrary tasks, utilizing power-efficient -neuromorphic chips that break the Von Neumann bottleneck. We classify -the training strategies by their usage of gradients, and discuss -certain optimization techniques. - -- Non-gradient based methods - - Spiking neurons communicate via spikes, hence, unlike ANNs, gradients - are non-existent. In addition, backpropagation is not biologically - plausible (see ). This motivates the use of - plasticity-based methods and evolutionary strategies for training - SNNs. - - One category of learning rules used in SNNs are local learning rules. - These rules include Hebbian learning (neurons that fire together wire - together), and its extension: the spike-timing-dependent-plasticity - rule (STDP). Inspired by experiments in neuroscience, central to these - learning rules is the theme that neuron spike ordering and their - relative timings encode information. STDP adjusts the strength of - connections between neurons using the relative timing of a neuron's - output and its input potentials (hence, spike-timing dependent). - - In machine learning terminology, the weights of the synapses are - adjusted according to fixed rules for each training example. Each - synapse is given a weight \\(0 \le w \le w\_{max}\\) , characterizing its - strength, and its change depends on the exact moments \\(t\_{pre}\\) of - pre-synaptic spikes and \\(t\_{post}\\) of post-synaptic spikes - (Alexander Sboev et al., 2018): - - \begin{equation} - \Delta w=\left\\{\begin{array}{l}{-\alpha \lambda \cdot \exp - \left(-\frac{t\_{\mathrm{pre}}-t\_{\mathrm{post}}}{\tau\_{-}}\right), - \text {if } t\_{\mathrm{pre}}-t\_{\mathrm{post}}>0} - \\ {\lambda \cdot \exp - \left(-\frac{t\_{\mathrm{post}}-t\_{\mathrm{pre}}}{\tau\_{+}}\right), - \text {if } - t\_{\mathrm{pre}}-t\_{\mathrm{post}}<0}\end{array}\right. - \end{equation} - - where \\(\tau\_{+}\\) and \\(\tau\_{-}\\) are time constants. \\(\tau\_{+} = 16.8ms\\) - and \\(\tau\_{-} = 33.7ms\\) are reasonable approximations obtained - experimentally. - - There are several libraries like BindsNET - (Hazan et al., 2018) that simulate SNNs on Von Neumann - computers implementing these rules. Recent attempts have been made to - combine Reinforcement Learning and STDP: both in solving RL problems - (Hazan et al., 2018), and using the reinforcement learning - framework to train SNN - (Bing et al., 2019), (Lee et al., 2018). However, SNNs - trained using the STDP learning rule have yet to achieve comparable - performance compared to ANNs on relatively simple datasets like MNIST - ("Amirhossein Tavanaei et al., 2019). - -- Gradient-based methods - - Performance is important for practical applications, and - gradient-based training methods such as backpropagation has shown - competitive performance. It is thus desirable to train spiking neural - networks with these gradient-based methods. - - There are several problems with spike-compatible gradient-based - methods. First, most of these methods cannot train neurons in the - hidden layers: they can only train neurons at the final layer, that - receive the desired target output pattern - (Robert Urbanczik \& Walter Senn, 2009), (Lee et al., 2016). - Second, the discontinuous, binary nature of spiking output needs to be - addressed. For example, SpikeProp approximates the membrane - threshold function at a local area with a linear function, introducing - gradients and computing the exact formulae for error backpropagation - for synaptic weights and spike times (Bohte et al., 2000). Others have - modified the threshold function with a gate function - @incollection{NIPS2018_7417, - title = {Gradient Descent for Spiking Neural Networks}, - author = {Huh, Dongsung and Sejnowski, Terrence J}, - booktitle = {Advances in Neural Information Processing Systems - 31}, - editor = {S. Bengio and H. Wallach and H. Larochelle and K. - Grauman and N. Cesa-Bianchi and R. Garnett}, - pages = {1433--1443}, - year = 2018, - publisher = {Curran Associates, Inc.}, - url = - {http://papers.nips.cc/paper/7417-gradient-descent-for-spiking-neural-networks.pdf} - }, used the alpha transfer function to derive - gradient update rules (Comsa et al., 2019), - and approximate the dirac-delta spikes with a probability density - function @incollection{NIPS2018_7415, - title = {SLAYER: Spike Layer Error Reassignment in Time}, - author = {Shrestha, Sumit Bam and Orchard, Garrick}, - booktitle = {Advances in Neural Information Processing Systems - 31}, - editor = {S. Bengio and H. Wallach and H. Larochelle and K. - Grauman and N. Cesa-Bianchi and R. Garnett}, - pages = {1412--1421}, - year = 2018, - publisher = {Curran Associates, Inc.}, - url = - {http://papers.nips.cc/paper/7415-slayer-spike-layer-error-reassignment-in-time.pdf} - }. - - Another approach is converting trained ANN models into SNNs - (Rueckauer et al., 2016). Common ANN layers such - as softmax, batch normalization and max-pooling layers have their - corresponding spiking counterparts. - - Equilibrium Propagation was recently proposed to solve the - neurobiological incompatibilities of backpropagation - (Scellier \& Bengio, 2017). Because the gradients are defined only - in terms of local perturbations, the synaptic updates correspond to - the standard form of STDP. The propagated signal encodes the gradients - of a well-defined objective function on energy-based models, where the - goal is to minimize the energy of the model. To resolve the issue of - communication using binary-valued signals, step-size annealing was - used to train spiking neural networks with Equilibrium Propagation - (O'Connor et al., 2019). - -- Future Research Areas - - A nascent area is local learning on neuromorphic chips. Thus far - spiking neural networks are simulated and trained before deployment on - a neuromorphic chip. In Intel's Loihi chip, each core contains a - learning engine that can update synaptic weights using the 4-bit - microcode-programmed learning rules that are associated with that - synapse. This opens up areas for online learning. - - -## The Spiking Neuron {#the-spiking-neuron} - -dendrites -: input device - -soma -: central processing unit (non-linear processing step). If the - total input exceeds a certain threshold, an output signal is generated - -axon -: output device, delivering signal to other neurons - -synapse -: junction between two neurons - -post/presynaptic cells -: If a neuron is sending a signal across a - synapse, the sending neuron is the presynaptic cell, and the - receiving neuron is the postsynaptic cell - -{{< figure src="/ox-hugo/screenshot_2019-08-19_09-49-28.png" >}} - -action potentials/spikes -: short electrical pulses, typically of - amplitude about 100mV and a duration of 1-2ms - -spike train -: a chain of action potentials (sequence of stereotyped - events) that occur at intervals. Since all spikes of - a given neuron look the same, the form of the spike - does not matter: the number and timing of the spikes - encode the information. - -absolute refractory period -: minimal distance between two spikes. - Spike are well separated, and it is impossible to excite a second - spike within this refractory period. - -relative refractory period -: follows the absolute refractory - period -- a period where it is difficult to excite an action - potential - -We define for presynaptic neuron \\(j\\), \\(\epsilon\_{ij}(t) = u\_{i}(t) - -u\_{rest}\\). For a few input spikes, the membrane potential responds -roughly linearly to the input spikes: - -\begin{equation} - u\_i{t} = \sum\_{j}\sum\_{f} \epsilon\_{ij}(t - t\_j^{(f)}) + u\_{rest} -\end{equation} - -If \\(u\_i(t)\\) reaches threshold \\(\vartheta\\) from below, neuron \\(i\\) fires -a spike. - -From the above, we can define the Spike Response Model describing the momentary -value of the membrane potential of neuron \\(i\\): - -\begin{equation} - u\_i{t} = \eta (t - \hat{t\_i}) + \sum\_{j}\sum\_{f} \epsilon\_{ij}(t - t\_j^{(f)}) + u\_{rest} -\end{equation} - -where \\(\hat{t\_i}\\) is the last firing time of neuron \\(i\\). - -We refer to moment when a given neuron emits an action potential as -the firing time of that neuron. We denote the firing times of neuron -\\(i\\) by \\(t\_i^{(f)}\\) where \\(f = 1,2,\dots\\) is the label of the spike. -Then we formally denote the spike train of a neuron \\(i\\) as the -sequence of firing times: - -\begin{equation} - S\_i(t) = \sum\_{f} \delta\left( t - t\_i^{(f)} \right) -\end{equation} - -where \\(\delta(x)\\) is the Dirac \\(\delta\\) function with \\(\delta(x) = 0\\) -for \\(x \ne 0\\) and \\(\int\_{-\infty}^{\infty} \delta(x)dx = 1\\). Spikes -are thus reduced to points in time. - -SRM only takes into account the most recent spike, and cannot capture -adaptation. - - -### Neuronal Coding {#neuronal-coding} - -How do spike trains encode information? At present, a definite answer -to this question is not known. - -- Temporal Coding - - Traditionally, it had been thought that information was contained in - the mean firing rate of a neuron: - - \begin{equation} - v = \frac{n\_{sp}(T)}{T} - \end{equation} - - measured over some time window \\(T\\), counting the number of the spikes - \\(n\\). The primary objection to this is that if we need to compute a - temporal average to transfer information, then our reaction times - would be a lot slower. - - From the point of view of rate coding, spikes are a convenient wa of - transmitting the analog output variable \\(v\\) over long spikes. The - optimal scheme is to transmit the value of rate \\(v\\) by a regular spike - train at intervals \\(\frac{1}{v}\\), allowing the rate to be reliably - measured after 2 spikes. Therefore, irregularities in real spike - trains must be considered as noise. - -- Rate as spike density (average over several runs) - - this definition works for both stationary and time-dependent stimuli. - The same stimulation sequence is repeated several times, and the - neuronal response is reported in a peri-stimulus-time histogram - (PSTH). We can obtain the spike density of the PSTH by: - - \begin{equation} - \rho(t) = \frac{1}{\Delta t} \frac{n\_K(t; t + \Delta t)}{K} - \end{equation} - - where \\(K\\) is the number of repetitions of the experiment. We can - smooth the results to get a continuous rate. - - The problem with this scheme is that it cannot be the decoding scheme - of the brain. This measure makes sense if there is always a population - of neurons with the same stimulus. This leads to population coding. - -- Rate as population activity (average over several neurons) - - This is a simple extension of the spike density measure, but adding - activity across a population of neurons. Population activity varies - rapidly and can reflect changes in the stimulus nearly - instantaneously, an advantage over temporal coding. However, it - requires a homogeneous population of neurons, which is hardly - realistic. - - -### Spike Codes {#spike-codes} - -These are coding strategies based on spike timing. - -- Time-to-first-spike - - A neuron which fires shortly after the reference signal (an abrupt - input, for example) may signal a strong stimulation, and vice-versa. - This estimate has been successfully used in an interpretation of - neuronal activity in primate motor cortex. - - The argument is that the brain does not have time to evaluate more - than one spike per neuron per processing step, and hence the first - spike should contain most of the relevant information. - -- Phase - - Oscillations are common in the olfactory system, and other areas of - the brain. Neuronal spike trains could then encode information in the - phase of a pulse, with respect to the background oscillation. - -- Correlations and Synchrony - - Synchrony between any pairs of neurons could signify special events - and convey information not contained in the firing rate of the - neurons. - - -### Spikes or Rates? {#spikes-or-rates} - -A code based on time-to-first-spike is consistent with a rate code: if -the mean firing rate of a neuron is high, then the time to first spike -is expected to occur early. Stimulus reconstruction with a linear -kernel can be seen as a special instance of a rate code. It is -difficult to draw a clear borderline between pulse and rate codes. The -key consideration in using any code is the ability for the system to -react quickly to changes in the input. If pulse coding is relevant, -information processing in the brain must be based on spiking neuron -models. For stationary input, spiking neuron models can be reduced to -rate models, but in other cases, this reduction is not possible. - - -## What are Spiking Neural Networks? {#what-are-spiking-neural-networks} - -1. Generally naturally recurrent -2. Inspired by biological information processing: mimics how the brain - functions - -Models of cortical hierarchies have inspired the architectural -principles of deep neural networks, but at the implementation level -there is only marginally similar to brain-like computation and analog -neural networks. - - -## What's different between DNNs and SNNs? {#what-s-different-between-dnns-and-snns} - -1. Artificial neural networks are mostly non-linear but continuous - -function approximators that operate on a common clock cycle, while -SNNs compute with asynchronous spikes that signal the occurrence of -some characteristic event. - - -## In what areas are SNN better? {#in-what-areas-are-snn-better} - -They exhibit favourable properties similar to brain circuits: - -1. low power consumption -2. analog computation -3. fast inference -4. event-driven processing -5. online learning -6. parallelism - -Deep SNNs are also most capable of making use of event-based sensors, -that are slowly becoming mature enough for production use. They can -utilize efficient temporal codes in their computations. Typically -sensory information from the outside world is sparse: this leads to -power efficiency. - -SNNs also enable pseudo-simultaneous information processing. Even for -multi-layer neural networks, spikes begin to propagate immediately to -higher layers as soon as the lower layer provides sufficient activity. -Initial output spikes are typically composed from incomplete -information. - - -## How does a SNN work? (Michael Pfeiffer \& Thomas Pfeil, 2018) {#how-does-a-snn-work} - -Neurons exchange information via spikes, and the information received -depends on: - -Firing frequencies -: relative timing of pre and post-synaptic - spikes, and the neuronal firing patterns - -Identity of synapses used -: which neurons are connected, whether - the synapse is inhibitory or excitatory, synaptic strength etc. - - -## Difficulties on training SNNs {#difficulties-on-training-snns} - -Conventional deep learning relies on gradient methods, such as -stochastic gradient descent. These require differentiable activation -functions. - -Integrating the timing of spikes requires additional effort. - -1. Binarization of ANNs: Conventional DNNs are trained with binary - activations, and maintain their synchronous mode of information processing -2. Conversion from ANNs: Conventional DNNs are trained with - backpropagation, and then all analog neurons are converted into - spiking neurons -3. Training of constrained networks: Before conversion, conventional - DNN training methods are used together with constraints that model - the properties of SNNs -4. Supervised learning with spikes: Direct training of SNNs using - variations of error backpropagation -5. Local learning rules at synapses, such as STDP - - -### Binarization of ANNs {#binarization-of-anns} - -Binary networks offer efficient inference, at the cost of slight -performance degradation. The performance benefits come from efficient -multiply-add operations (using XNOR, bit-counting etc.), and low -precision computation. - -Non-differentiability of the output of the SNN makes it difficult to -train SNNs with conventional backpropagation methods. Some learning -rules approximate the derivative by smoothing out the membrane -potential as a function of the weights. - - -### Conversion from ANNs {#conversion-from-anns} - -The initial approach was to convert activations of analog neurons into -firing rates of spiking ones. The Neural Engineering Framework also -allows conversion of RBMs into SNNs. Conversion from ANNs provide the -full toolkit of deep learning for training. - -However, some ANNs are difficult to convert to SNNs. For example, -negative activations are difficult to convert to firing rates, since -firing rates are always positive. ReLUs are easier to convert, having -activations being only zero or positive. - - -### Training under SNN constraints {#training-under-snn-constraints} - -Constrain-then-train includes constraints from the properties of -spiking neurons during the training process. Conventional ANN learning -methods such as backpropagation are then used to learn the optimal -weights under these constraints. - - -### Supervised Learning with Spikes {#supervised-learning-with-spikes} - -The key for many spike-based learning rules for multi-layer SNNs is to -find a real-valued and almost-everywhere differentiable proxy, on -which backpropagation can be performed. SpikeProp derives a -backpropagation rule for spike times in the output layer. Spike-based -backpropagation methods exist, such as performing gradient descent on -real-valued membrane potentials. - - -### Local Learning Rules {#local-learning-rules} - -From a practical perspective, local learning is desirable as it allows -for hardware-efficient learning. However, supervised error signals are -typically only available in the output layer, and it is unclear how to -propagate the errors to lower layers. Hence, recurrent feedback -connections are introduced to modulate training in these lower layers. - -Local learning rules such as Hebbian learning and -Spike-timing-dependent-plasticity (STDP) are have been used to train -competitive networks that are able to do clustering. - - -## Probabilistic SNNs {#probabilistic-snns} - -A probabilistic model defines the outputs of all spiking neurons as -jointly distributed binary random processes. The joint distribution is -differentiable in the synaptic weights, and principled learning -criteria from statistics and information theory such as likelihood and -mutual information apply. The maximization of such criteria do not -require the implementation of the backpropagation mechanism, and often -recover as special cases known biologically plausible algorithms. - - -## Graphical Representation {#graphical-representation} - -A SNN consists of a network of \\(N\\) spiking neurons. At any time \\(t = -0,1,2, \dots\\) each neouron \\(i\\) outputs a binary signal \\(s\_{i,t} = -\\{0,1\\}\\), with value \\(s\_{i,t} = 1\\) corresponding to a spike emitted at -time \\(t\\). We collect in vector \\(s\_{t} = \left( s\_{i,t}: i \in V \right)\\) -the binary signals emitted by all neurons at time \\(t\\), where \\(V\\) is -the set of all neurons. Each neuron \\(i \in V\\) receives the signals -emitted by a subset \\(P\_i\\) of neurons through directed links, known as -synapses. Neurons in a set \\(P\_i\\) are referred to as _pre-synaptic_ for -_post-synaptic_ neuron \\(i\\). - -The internal, analog state of each spiking neuron \\(i \in V\\) at time -\\(t\\) is defined by its membrane potential \\(u\_{i,t}\\). - - -## Long short-term memory and learning-to-learn in networks of spiking neurons (Bellec et al., 2018) {#long-short-term-memory-and-learning-to-learn-in-networks-of-spiking-neurons} - -**Key contribution**: Inclusion of adapting neurons into recurrent SNN -models (RSNNs) increases computing and learning capability. By using a -learning algorithm that combines BPTT with a rewiring algorithm that -optimizes the network architecture, performance comes close to LSTM -ANNs. - -**Model composition**: LSNNs consist of a populaction \\(R\\) of -integrate-and-fire (LIF) neurons (excitatory and inhibitory), and a -second population \\(A\\) of LIF excitatory neurons whose excitability is -temporarily reduced through preceding firing activity. \\(R\\) and \\(A\\) -receive spike trains from a population \\(X\\) of external input neurons. -Results of computations are read out by a population \\(Y\\) of external -linear readout neurons. - -{{< figure src="/ox-hugo/screenshot_2019-08-20_09-44-11.png" >}} - -BPTT is done by replacing the non-continuous membrane potential with -a pseudo derivative that smoothly increases from 0 to 1. - - -### Learning to Learn LSNNs {#learning-to-learn-lsnns} - -> LSTM networks are especially suited for L2L since they can -> accommodate two levelsof learning and representation of learned -> insight: Synaptic connections and weights can encode,on a higher -> level, a learning algorithm and prior knowledge on a large time-scale. -> The short-termmemory of an LSTM network can accumulate, on a lower -> level of learning, knowledge during thecurrent learning task - - -## Gradient Descent for Spiking Neural Networks (Huh \& Sejnowski, 2017) {#gradient-descent-for-spiking-neural-networks} - -key idea: Replacing the non-differentiable model for membrane -potential: - -\begin{equation} - \tau \dot{s} = -s + \sum\_{k} \delta (t - t\_k) -\end{equation} - -with - -\begin{equation} -\tau \dot{s} = -s + g \dot{v} -\end{equation} - -for some gate function \\(g\\), and \\(\dot{v}\\) is the time derivative of -the pre-synaptic membrane voltage. - -Exact gradient calculations can be done with BPTT, or real-time -recurrent learning. The resultant gradients are similar to -reward-modulated spike-time dependent plasticity. - - -## TODO Surrogate Gradient Learning in Spiking Neural Networks (Neftci et al., 2019) {#surrogate-gradient-learning-in-spiking-neural-networks} - - -## TODO Theories of Error Back-Propagation in the Brain (James Whittington \& Rafal Bogacz, 2019) {#theories-of-error-back-propagation-in-the-brain} - - -## [Temporal coding in spiking neural networks with alpha synaptic function]({{< relref "temporal-coding-comsa" >}}) {#temporal-coding-in-spiking-neural-networks-with-alpha-synaptic-function--presentations-temporal-coding-comsa-dot-md} - - -## STDP {#stdp} - -STDP is a biologically inspired long-term plasticity model, in which -each synapse is given a weight \\(0 \le w \le w\_{maxx}\\) , characterizing its -strength, and its change depends on the exact moments \\(t\_{pre}\\) of -presynaptic spikes and \\(t\_{post}\\) of postsynaptic spikes: - -\begin{equation} - \Delta w=\left\\{\begin{array}{l}{-\alpha \lambda \cdot \exp - \left(-\frac{t\_{\mathrm{pre}}-t\_{\mathrm{post}}}{\tau\_{-}}\right), - \text {if } t\_{\mathrm{pre}}-t\_{\mathrm{post}}>0} - \\ {\lambda \cdot \exp - \left(-\frac{t\_{\mathrm{post}}-t\_{\mathrm{pre}}}{\tau\_{+}}\right), - \text {if } - t\_{\mathrm{pre}}-t\_{\mathrm{post}}<0}\end{array}\right. -\end{equation} - -This additive STDP rule requires also an additional constraint that -explicitly prevents the weight from falling below 0 or exceeding the -maximum value of 1. - -(Alexander Sboev et al., 2018) - - -## Loihi {#loihi} - -- Describes SNNs as a weighted, directed graph \\( G(V, E)\\) where the - vertices \\(V\\) represent compartments, and the weighted edges \\(E\\) - represent synapses. -- Both compartments and synapses maintain internal state and - communicate only via discrete spike impulses. -- Uses a variant of the CUBA model for the neuron model, which is - defined as a set of first-order differential equation using traces, - evaluated at discrete algorithmic time steps. - -Learning must follow the sum-of-products form: - -\begin{equation} - Z(t) = Z(t-1) + \sum\_m S\_m \prod\_n F\_n -\end{equation} - -where \\(Z\\) is the synaptic state variable defined for the source -destination neuron pair being updated, and \\(F-N\\) may be a synaptic -state variable, a pre-synaptic trace or a post-synaptic trace defined -for the neuron pair. - - -## Generating Spike Trains {#generating-spike-trains} - - -### Poisson Model (Heeger, 2000) {#poisson-model} - -Independent spike hypothesis: the generation of each spike is -independent of all other spikes. If the underlying instantaneous -firing rate \\(r\\) is constant over time, it is a homogeneous Poisson -process. - -We can write: - -\begin{equation} - P(\textrm{1 spike during } \delta t) \approx r \delta t -\end{equation} - -We divide time into short, discrete intervals \\(\delta t\\). Then, we -generate a sequence of random numbers \\(x[i]\\) uniformly between 0 -and 1. For each interval, if \\(x[i] \le r \delta t\\), generate a spike. - - -## {#} - -# Bibliography -Ivanov, S., & D'yakonov, A., *Modern Deep Reinforcement Learning Algorithms*, CoRR, *()*, (2019). [↩](#e4502bc8449685a4d2f3de467131d52b) - -Li, Y., *Deep Reinforcement Learning*, CoRR, *()*, (2018). [↩](#d2a106a2198bf39695c45979d9300abc) - -Maass, W., *Networks of spiking neurons: the third generation of neural network models*, Neural Networks, *10(9)*, 1659–1671 (1997). http://dx.doi.org/https://doi.org/10.1016/S0893-6080(97)00011-7 [↩](#622a28118bfc276eace4e2997e32387a) - -Cybenko, G., *Approximation by superpositions of a sigmoidal function*, Mathematics of Control, Signals and Systems, *2(4)*, 303–314 (1989). http://dx.doi.org/10.1007/BF02551274 [↩](#6e22be1723df8ebb3d0e65e120ff8b92) - -Pfeiffer, M., & Pfeil, T., *Deep learning with spiking neurons: opportunities and challenges*, Frontiers in neuroscience, *12()*, (2018). [↩](#ffec32504761d0b966ab6c36eee992a6) - -Robert G\"utig, *To spike, or when to spike?*, Current Opinion in Neurobiology, *25(nil)*, 134–139 (2014). http://dx.doi.org/10.1016/j.conb.2014.01.004 [↩](#b77caeaea9e23a2bc9c87b5f10a91487) - -Stemmler, M., *A single spike suffices: the simplest form of stochastic resonance in model neurons*, Network: Computation in Neural Systems, *7(4)*, 687–716 (1996). http://dx.doi.org/10.1088/0954-898x_7_4_005 [↩](#b7885fc5161a6ad3286ee312ffcc0c0b) - -Comsa, I. M., Potempa, K., Versari, L., Fischbacher, T., Gesmundo, A., & Alakuijala, J., *Temporal coding in spiking neural networks with alpha synaptic function*, CoRR, *()*, (2019). [↩](#caaddec51f6948e5fea79b6d41c79676) - -Tavanaei, A., Ghodrati, M., Kheradpisheh, S. R., Masquelier, T., & Maida, A., *Deep learning in spiking neural networks*, Neural Networks, *111()*, 47–63 (2019). http://dx.doi.org/https://doi.org/10.1016/j.neunet.2018.12.002 [↩](#cf477ffda17db950a7fd58c9d833182b) - -Merolla, P. A., Arthur, J. V., Alvarez-Icaza, R., Cassidy, A. S., Sawada, J., Akopyan, F., Jackson, B. L., …, *A million spiking-neuron integrated circuit with a scalable communication network and interface*, Science, *345(6197)*, 668–673 (2014). http://dx.doi.org/10.1126/science.1254642 [↩](#ff5e58b063893165385318f053dc98c9) - -Davies, M., Srinivasa, N., Lin, T., Chinya, G., Cao, Y., Choday, S. H., Dimou, G., …, *Loihi: a neuromorphic manycore processor with on-chip learning*, IEEE Micro, *38(1)*, 82–99 (2018). [↩](#8146155533911feae2a67ddf637b1e29) - -Tang, G., Shah, A., & Michmizos, K. P., *Spiking neural network on neuromorphic hardware for energy-efficient unidimensional slam*, CoRR, *()*, (2019). [↩](#162706e1b73312c94623c3c6304f9856) - -Severa, W., Parekh, O., Carlson, K. D., James, C. D., & Aimone, J. B., *Spiking network algorithms for scientific computing*, 2016 IEEE International Conference on Rebooting Computing (ICRC), *()*, 1–8 (2016). [↩](#022dd7a783479dfb761bf88b30399ee3) - -Sboev, A., Vlasov, D., Rybka, R., & Serenko, A., *Spiking neural network reinforcement learning method based on temporal coding and stdp*, Procedia Computer Science, *145(nil)*, 458–463 (2018). http://dx.doi.org/10.1016/j.procs.2018.11.107 [↩](#5c8bcfe50f375b189e564db4d78fe1a3) - -Hazan, H., Saunders, D. J., Khan, H., Patel, D., Sanghavi, D. T., Siegelmann, H. T., & Kozma, R., *Bindsnet: a machine learning-oriented spiking neural networks library in python*, Frontiers in Neuroinformatics, *12()*, 89 (2018). http://dx.doi.org/10.3389/fninf.2018.00089 [↩](#b266899abe9f6133f1e6d55ad24513db) - -Bing, Z., Baumann, I., Jiang, Z., Huang, K., Cai, C., & Knoll, A., *Supervised learning in snn via reward-modulated spike-timing-dependent plasticity for a target reaching vehicle*, Frontiers in Neurorobotics, *13()*, 18 (2019). http://dx.doi.org/10.3389/fnbot.2019.00018 [↩](#54e69da24e936643028e5c2591a092e6) - -Lee, C., Panda, P., Srinivasan, G., & Roy, K., *Training deep spiking convolutional neural networks with stdp-based unsupervised pre-training followed by supervised fine-tuning*, Frontiers in Neuroscience, *12()*, 435 (2018). http://dx.doi.org/10.3389/fnins.2018.00435 [↩](#cb84873c6f16a361dfb01de00ae1425a) - -Urbanczik, R., & Senn, W., *A gradient learning rule for the tempotron*, Neural Computation, *21(2)*, 340–352 (2009). http://dx.doi.org/10.1162/neco.2008.09-07-605 [↩](#78cca07dd56a8c50ebd16d663c3b095d) - -Lee, J., Delbruck, T., & Pfeiffer, M., *Training Deep Spiking Neural Networks Using Backpropagation*, Frontiers in Neuroscience, *10()*, (2016). http://dx.doi.org/10.3389/fnins.2016.00508 [↩](#9a5e9b63107e695a46943df33a811909) - -Bohte, S., Kok, J., & Poutré, J., *Spikeprop: backpropagation for networks of spiking neurons.*, In , (pp. 419–424) (2000). : . [↩](#41ed49a4572e3909921301127000035c) - -Huh, D., & Sejnowski, T. J., *Gradient descent for spiking neural networks*, In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, & R. Garnett (Eds.), Advances in Neural Information Processing Systems 31 (pp. 1433–1443) (2018). : Curran Associates, Inc. [↩](#2b991fd4ef5412f89154985cec53e4e8) - -Shrestha, S. B., & Orchard, G., *Slayer: spike layer error reassignment in time*, In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, & R. Garnett (Eds.), Advances in Neural Information Processing Systems 31 (pp. 1412–1421) (2018). : Curran Associates, Inc. [↩](#123af3c690cf296b196d898878568449) - -Rueckauer, B., Lungu, I., Hu, Y., & Pfeiffer, M., *Theory and tools for the conversion of analog to spiking convolutional neural networks*, CoRR, *()*, (2016). [↩](#f842b3cf76d4cc279ae01a4cf75c48ba) - -Scellier, B., & Bengio, Y., *Equilibrium propagation: bridging the gap between energy-based models and backpropagation*, Frontiers in Computational Neuroscience, *11()*, 24 (2017). http://dx.doi.org/10.3389/fncom.2017.00024 [↩](#38c93c265031c562bcf3ab3a89b9d896) - -O'Connor, P., Gavves, E., & Welling, M., *Training a spiking neural network with equilibrium propagation*, In K. Chaudhuri, & M. Sugiyama, Proceedings of Machine Learning Research (pp. 1516–1523) (2019). : PMLR. [↩](#d1886fb7b4cde1636a730b6072eb45c5) - -Pfeiffer, M., & Pfeil, T., *Deep learning with spiking neurons: opportunities and challenges*, Frontiers in Neuroscience, *12(nil)*, (2018). http://dx.doi.org/10.3389/fnins.2018.00774 [↩](#4980de9e86c6598545afbb2a4bdd8cb8) - -Bellec, G., Salaj, D., Subramoney, A., Legenstein, R., & Maass, W., *Long short-term memory and learning-to-learn in networks of spiking neurons*, CoRR, *()*, (2018). [↩](#4917683f67ccf52378654f00a9c9a141) - -Huh, D., & Sejnowski, T. J., *Gradient descent for spiking neural networks*, CoRR, *()*, (2017). [↩](#7cd889cc568ca0abd92ccb282abe3ae7) - -Neftci, E. O., Mostafa, H., & Zenke, F., *Surrogate gradient learning in spiking neural networks*, CoRR, *()*, (2019). [↩](#6c46e273de1ecbecce7f8f1ac7329a57) - -Whittington, J. C., & Bogacz, R., *Theories of error back-propagation in the brain*, Trends in Cognitive Sciences, *23(3)*, 235–250 (2019). http://dx.doi.org/10.1016/j.tics.2018.12.005 [↩](#87673c771a23a8ad0a1301cb565d0484) - -Heeger, D., *Poisson model of spike generation*, Handout, University of Standford, *5()*, 1–13 (2000). [↩](#15fef7332c23705120f84cb94df313f0) diff --git a/org/docker.org b/org/docker.org index 3527ca38..d7749f26 100644 --- a/org/docker.org +++ b/org/docker.org @@ -5,7 +5,7 @@ #+AUTHOR: Jethro Kuan #+EMAIL: jethrokuan95@gmail.com -- tags :: [[file:linux.org][§linux]], [[file:operating_systems.org][§operating_systems]] +- tags :: [[file:linux.org][Linux]], [[file:operating_systems.org][Operating Systems]] * Why Containers :PROPERTIES: diff --git a/org/emti_dl_with_bayesian_principles.org b/org/emti_dl_with_bayesian_principles.org index 4a817ba8..4f96eccd 100644 --- a/org/emti_dl_with_bayesian_principles.org +++ b/org/emti_dl_with_bayesian_principles.org @@ -79,7 +79,7 @@ approximation $q$, and giving away the global property of the rule. ** Deriving Gradient Descent Gradient descent is derived from using a Gaussian with fixed -covariance, and approximating $E_q[l(\theta)] \approx l(m).$ +covariance, and approximating $E_q[l(\theta)] \approx l(m)$. * Resources - [[https://emtiyaz.github.io/papers/learning_from_bayes.pdf]] diff --git a/org/gcc.org b/org/gcc.org index 649e29e1..32cb01b5 100644 --- a/org/gcc.org +++ b/org/gcc.org @@ -1,7 +1,7 @@ #+TITLE: GCC #+SETUPFILE: ./hugo_setup.org -- tags :: [[file:compilers.org][§compilers]], [[file:cplusplus.org][§cplusplus]], [[file:c_lang.org][§c_lang]] +- tags :: [[file:compilers.org][Compilers]], [[file:c_lang.org][The C Language]] * Building GCC Instead of downloading the tarball, we clone from the Git mirror, diff --git a/shell.nix b/shell.nix index 061c11ba..b988d8a5 100644 --- a/shell.nix +++ b/shell.nix @@ -2,6 +2,8 @@ with import {}; pkgs.mkShell { buildInputs = with pkgs; [ + nodejs + nodePackages.prettier hugo ]; shellHook = '' diff --git a/themes/cortex b/themes/cortex index 168902c3..25064343 160000 --- a/themes/cortex +++ b/themes/cortex @@ -1 +1 @@ -Subproject commit 168902c3358fde3716d25c7c16aa16186578e8ec +Subproject commit 25064343c2af195a418afe1d7d62c02afdca9ec7