Preimplemented Models

Preimplemented Models

ModelFactory

A collection of functions to generate the feedback networks and baseline models used in evaluations and examples.

LeNet5

Reimplementation of the LeNet5 architecture from

LeCun, Bottou, Bengio & Haffner (1998), Gradient-based learning applied to document recognition. Procedings of the IEEE 86(11), 2278-2324.

and a version of LeNet5 with feedback connections.

ModelFactory.jl contains a modified version of the LeNet5 architecture from

LeCun, Bottou, Bengio & Haffner (1998),
Gradient-based learning applied to document recognition.
Procedings of the IEEE 86(11), 2278-2324.

as well as a version with feedback connections.

lenet5(; σ=tanh, pad=2)

Generate the LeNet5 architecture from LeCun et al. (1998) with small modifications.

Details

The implementation differs from the original LeNet5, as the output layer does not compute radial basis functions, but is a normal Dense layer with a softmax. The input image is padded. The network assumes a 32x32 input, so for MNIST digits a pad of 2 is appropriate. The non-linearity can be customized via the σ argument. The standard is tanh, whereas the original LeNet5 used x -> 1.7159 .* tanh(x).

lenet5_fb(; σ=tanh, pad=2)

Generate the LeNet5 architecture from LeCun et al. (1998) with feedback connections and small modifications.

In addition, there is a wrapper to more easily generate a Flux.Recur for the feedback model.

wrapfb_lenet5(net, batchsize; generator=zeros)

Wrap a letnet5_fb network in a Flux.Recur, assuming that batches are of size batchsize and using the given generator to initialize the state.

Networks by Spoerer et al.

This module reimplements models from the paper:

Spoerer, C.J., McClure, P. and Kriegeskorte, N. (2017).
Recurrent convolutional neural networks: a better model of biological object recognition.
Frontiers in Psychology 8, 1551.

The paper contains six network architectures:

spoerer_model_b(T; channels=1, inputsize=(28, 28), classes=10)

Generate the bottom-up (B) convolutional neural network from:

Spoerer, C.J., McClure, P. & Kriegeskorte, N. (2017).
Recurrent convolutional neural networks: a better model of biological object recognition.
Frontiers in Psychology 8, 1551.
spoerer_model_bk(T; channels=1, inputsize=(28, 28), classes=10)

Generate the convolutional neural network with increased kernel size (BK) from:

Spoerer, C.J., McClure, P. & Kriegeskorte, N. (2017).
Recurrent convolutional neural networks: a better model of biological object recognition.
Frontiers in Psychology 8, 1551.
spoerer_model_bf(T; channels=1, inputsize=(28, 28), classes=10)

Generate the convolutional neural network with additional feature maps (BF) from:

Spoerer, C.J., McClure, P. & Kriegeskorte, N. (2017).
Recurrent convolutional neural networks: a better model of biological object recognition.
Frontiers in Psychology 8, 1551.
spoerer_model_bl(T; channels=1, inputsize=(28, 28), kernel=(3,3), features=32, classes=10)

Generate the convolutional neural network with lateral recurrence (BL) from:

Spoerer, C.J., McClure, P. & Kriegeskorte, N. (2017).
Recurrent convolutional neural networks: a better model of biological object recognition.
Frontiers in Psychology 8, 1551.
spoerer_model_bt(T; channels=1, inputsize=(28, 28), kernel=(3,3), features=32, classes=10)

Generate the convolutional neural network with top-down recurrence (BT) from:

Spoerer, C.J., McClure, P. & Kriegeskorte, N. (2017).
Recurrent convolutional neural networks: a better model of biological object recognition.
Frontiers in Psychology 8, 1551.
spoerer_model_blt(T; channels=1, inputsize=(28, 28), kernel=(3,3), features=32, classes=10)

Generate the convolutional neural network with lateral and top-down recurrence (BLT) from:

Spoerer, C.J., McClure, P. & Kriegeskorte, N. (2017).
Recurrent convolutional neural networks: a better model of biological object recognition.
Frontiers in Psychology 8, 1551.

The first three architectures (B, BK, BF) are feedforward and are internally implemented with one function:

spoerer_model_fw(T; channels=1, inputsize=(28, 28), kernel=(3,3), features=32, classes=10)

Generate one of the forward models (B, B-K, B-F) from the paper:

Spoerer, C.J., McClure, P. & Kriegeskorte, N. (2017).
Recurrent convolutional neural networks: a better model of biological object recognition.
Frontiers in Psychology 8, 1551.