// Prediction layer // public void AddPredictionLayer(FNodeSet Fields, ScalarFunction Activator, NodeReduction Reducer) { this._PredictionActivation = Activator; this._YValues = Fields; this._PredictionReducer = Reducer; }
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; }
// 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)); }
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; }