Class: Layer

Layer

new Layer(size, input_size, Neuron)

A single layer of neurons. Networks process input through multiple layers.
Parameters:
Name Type Description
size number Number of neurons in the layer.
input_size number Length of input arrays.
Neuron object (optional) Class used to initialize neurons. Defaults to SigmoidNeuron.
Source:

Methods

neuron(i, neuron)

Getter / setter for the layer's neurons, individually.
Parameters:
Name Type Description
i number Index of the neuron to get or set.
neuron object (optional) A single neuron, which replaces the i'th neuron. If undefined, returns the i'th neuron.
Source:

neurons(neurons)

Getter / setter for the layer's neurons.
Parameters:
Name Type Description
neurons array (optional) A list of neurons to replace the layer's current neurons. If undefined, returns the list of current neurons.
Source:

process(input)

Given an array of input bits, returns the layer's output when the input is applied to each neuron.
Parameters:
Name Type Description
input array array of input bits
Source: