Encog.Neural.Networks.BasicNetwork.SetLayerBiasActivation C# (CSharp) Method

SetLayerBiasActivation() public method

Set the bias activation for the specified layer.
public SetLayerBiasActivation ( int l, double v ) : void
l int The layer to use.
v double
return void
        public void SetLayerBiasActivation(int l, double v)
        {
            if (!IsLayerBiased(l))
            {
                throw new NeuralNetworkError(
                    "Error, the specified layer does not have a bias: " + l);
            }

            _structure.RequireFlat();
            int layerNumber = LayerCount - l - 1;

            int layerOutputIndex = _structure.Flat.LayerIndex[layerNumber];
            int count = _structure.Flat.LayerCounts[layerNumber];
            _structure.Flat.LayerOutput[layerOutputIndex + count - 1] = v;
        }