/** * Increase the hidden layer counts according to the hidden layer * parameters. Increase the first hidden layer count by one, if * it is maxed out, then set it to zero and increase the next * hidden layer. * @return False if no more increases can be done, true otherwise. */ private bool IncreaseHiddenCounts() { int i = 0; do { HiddenLayerParams param = this.hidden[i]; this.hiddenCounts[i]++; // is this hidden layer still within the range? if (this.hiddenCounts[i] <= param.Max) { return(true); } // increase the next layer if we've maxed out this one this.hiddenCounts[i] = param.Min; i++; } while (i < this.hiddenCounts.Length); // can't increase anymore, we're done! return(false); }
/** * Add a hidden layer's min and max. Call this once per hidden layer. * Specify a zero min if it is possible to remove this hidden layer. * * @param min * The minimum number of neurons for this layer. * @param max * The maximum number of neurons for this layer. */ public void AddHiddenLayer(int min, int max) { HiddenLayerParams param = new HiddenLayerParams(min, max); this.hidden.Add(param); }
/** * Add a hidden layer's min and max. Call this once per hidden layer. * Specify a zero min if it is possible to remove this hidden layer. * * @param min * The minimum number of neurons for this layer. * @param max * The maximum number of neurons for this layer. */ public void AddHiddenLayer(int min, int max) { HiddenLayerParams param = new HiddenLayerParams(min, max); this.hidden.Add(param); }