src/neuron.js
/**
     * Calculates the neuron's activation for the given input based on current
     * weights and bias. Stores the sum(weights * inputs) and input to the
     * neuron state, for use in the backpropagation pass.
     * @param {Array.<number>} input Input vector for the neuron
     * @returns {number} Activation of the neuron
     */
Calculates the neuron's activation for the given input based on current
weights and bias. Stores the sum(weights * inputs) and input to the
neuron state, for use in the backpropagation pass.
@param {Array.} input Input vector for the neuron
@returns {number} Activation of the neuron
Calculates the neuron ' s activation for the given input based on current weights and bias . Stores the sum ( weights * inputs ) and input to the neuron state for use in the backpropagation pass . @param { Array . } input Input vector for the neuron @returns { number } Activation of the neuron
activate(input) {
        this.inputs = input;
        this.activation =
            input
                .map((value, index) => value * this.weights[index])
                .reduce((value, sum) => sum + value) + this.bias;
        return this.nonlinearity.forward(this.activation);
    }
activate ( input ) { this . inputs = input ; this . activation = input . map ( ( value , index ) => value * this . weights [ index ] ) . reduce ( ( value , sum ) => sum + value ) + this . bias ; return this . nonlinearity . forward ( this . activation ) ; }
Calculates the neuron's activation for the given input based on current
 weights and bias.
Calculates the neuron ' s activation for the given input based on current weights and bias .