Пример #1
0
 // Prediction layer //
 public void AddPredictionLayer(FNodeSet Fields, ScalarFunction Activator, NodeReduction Reducer)
 {
     this._PredictionActivation = Activator;
     this._YValues = Fields;
     this._PredictionReducer = Reducer;
 }
Пример #2
0
 // Hidden layer //
 public void AddHiddenLayer(bool Bias, int DynamicCount, ScalarFunction Activator, NodeReduction Reducer)
 {
     this._HiddenLayers.Add(new NN_Layer(Bias, Reducer, Activator, DynamicCount, this._HiddenLayers.Count + 1));
 }
Пример #3
0
 public void AddHiddenLayer(bool Bias, int DynamicCount, ScalarFunction Activator)
 {
     this.AddHiddenLayer(Bias, DynamicCount, Activator, this.DefaultReduction);
 }
Пример #4
0
            public NN_Layer(bool Bias, NodeReduction Connector, ScalarFunction Activator, int TotalCount, int Level)
                : this()
            {

                // Check if rendered //
                if (this._IsRendered)
                    throw new Exception("Layer already rendered");

                // Check the total count //
                if (TotalCount < 1)
                    throw new Exception("Cannot have fewer than one node");

                // Add the bias node //
                if (Bias)
                    this._Nodes.Add(new NeuralNodeStatic(string.Format("H{0}_0", Level), 1));

                // Add the references //
                for (int i = 0; i < TotalCount; i++)
                    this._Nodes.Add(new NeuralNodeDynamic(string.Format("H{0}_{1}", Level, i + 1), Activator, Connector));

                // Tag as rendered //
                this._IsRendered = true;

            }
Пример #5
0
            public NN_Layer(NodeReduction Connector, ScalarFunction Activator, Key Fields)
                : this()
            {

                // Check if rendered //
                if (this._IsRendered)
                    throw new Exception("Layer already rendered");

                // Add the references //
                for (int i = 0; i < Fields.Count; i++)
                    this._Nodes.Add(new NeuralNodePrediction("Y" + i.ToString(), Activator, Connector, Fields[i]));

                // Tag as rendered //
                this._IsRendered = true;

            }
Пример #6
0
 public void AddPredictionLayer(FNodeSet Fields, ScalarFunction Activator)
 {
     this.AddPredictionLayer(Fields, Activator, this.DefaultReduction);
 }
Пример #7
0
 public void AddOutputLayer(int[] Offsets, ScalarFunction Activator)
 {
     if (this._phase != 0)
         throw new InvalidOperationException("Cannot alter the state of the network after it has been constructed");
     this._terminis = new OutputLinearLayer(Offsets, Activator);
 }
Пример #8
0
        public void AddHiddenLayer(int Size, bool Bias, ScalarFunction Activator)
        {

            if (this._phase != 0)
                throw new InvalidOperationException("Cannot alter the state of the network after it has been constructed");
            DynamicLinearLayer layer = new DynamicLinearLayer(Size, Bias, Activator);
            this._layer_tree.Add(layer);

        }
Пример #9
0
 public OutputLinearLayer(int[] Offsets, ScalarFunction Activation)
     : base(Offsets.Length, false)
 {
     this.OFFSETS = Offsets;
     this.ACT = Activation;
     this.Affinity = NeuralLayerAffinity.Output;
 }
Пример #10
0
 public DynamicLinearLayer(int Size, bool Bias, ScalarFunction Activation)
     : base(Size + (Bias ? 1 : 0), Bias)
 {
     this.ACT = Activation;
     this.Affinity = NeuralLayerAffinity.Dynamic;
 }