Encog.Neural.Networks.Structure.NeuralStructure.FinalizeStructure C# (CSharp) Method

FinalizeStructure() public method

Build the synapse and layer structure. This method should be called after you are done adding layers to a network, or change the network's logic property.
public FinalizeStructure ( ) : void
return void
        public void FinalizeStructure()
        {
            if (_layers.Count < 2)
            {
                throw new NeuralNetworkError(
                    "There must be at least two layers before the structure is finalized.");
            }

            var flatLayers = new FlatLayer[_layers.Count];

            for (int i = 0; i < _layers.Count; i++)
            {
                var layer = (BasicLayer) _layers[i];
                if (layer.Activation == null)
                {
                    layer.Activation = new ActivationLinear();
                }

                flatLayers[i] = layer;
            }

            _flat = new FlatNetwork(flatLayers);

            FinalizeLimit();
            _layers.Clear();
            EnforceLimit();
        }