Пример #1
0
 public override sealed object Clone()
 {
     FlatNetworkRBF result = new FlatNetworkRBF();
     base.CloneFlatNetwork(result);
     result._rbf = this._rbf;
     return result;
 }
Пример #2
0
        /// <summary>
        /// Construct RBF network.
        /// </summary>
        ///
        /// <param name="inputCount">The input count.</param>
        /// <param name="hiddenCount">The hidden count.</param>
        /// <param name="outputCount">The output count.</param>
        /// <param name="t">The RBF type.</param>
        public RBFNetwork(int inputCount, int hiddenCount,
                          int outputCount, RBFEnum t)
        {
            if (hiddenCount == 0)
            {
                throw new NeuralNetworkError(
                    "RBF network cannot have zero hidden neurons.");
            }

            var rbf = new IRadialBasisFunction[hiddenCount];

            // Set the standard RBF neuron width.
            // Literature seems to suggest this is a good default value.
            double volumeNeuronWidth = 2.0d/hiddenCount;

            _flat = new FlatNetworkRBF(inputCount, rbf.Length, outputCount, rbf);

            try
            {
                // try this
                SetRBFCentersAndWidthsEqualSpacing(-1, 1, t, volumeNeuronWidth,
                                                   false);
            }
            catch (EncogError)
            {
                // if we have the wrong number of hidden neurons, try this
                RandomizeRBFCentersAndWidths(-1, 1, t);
            }
        }
Пример #3
0
 public RBFNetwork(int inputCount, int hiddenCount, int outputCount, RBFEnum t)
 {
     if (hiddenCount != 0)
     {
         IRadialBasisFunction[] rbf = new IRadialBasisFunction[hiddenCount];
         double volumeNeuronRBFWidth = 2.0 / ((double) hiddenCount);
         this._flat = new FlatNetworkRBF(inputCount, rbf.Length, outputCount, rbf);
         try
         {
             this.SetRBFCentersAndWidthsEqualSpacing(-1.0, 1.0, t, volumeNeuronRBFWidth, false);
         }
         catch (EncogError)
         {
             this.RandomizeRBFCentersAndWidths(-1.0, 1.0, t);
         }
     }
     else
     {
         do
         {
             throw new NeuralNetworkError("RBF network cannot have zero hidden neurons.");
         }
         while ((((uint) outputCount) | 2) == 0);
     }
 }
Пример #4
0
 public RBFNetwork(int inputCount, int outputCount, IRadialBasisFunction[] rbf)
 {
     FlatNetworkRBF krbf = new FlatNetworkRBF(inputCount, rbf.Length, outputCount, rbf) {
         RBF = rbf
     };
     this._flat = krbf;
 }
        /// <summary>
        /// Clone the network.
        /// </summary>
        ///
        /// <returns>A clone of the network.</returns>
        public override sealed Object Clone()
        {
            var result = new FlatNetworkRBF();

            CloneFlatNetwork(result);
            result._rbf = _rbf;
            return(result);
        }
Пример #6
0
 /// <summary>
 /// Clone the network.
 /// </summary>
 ///
 /// <returns>A clone of the network.</returns>
 public override sealed Object Clone()
 {
     var result = new FlatNetworkRBF();
     CloneFlatNetwork(result);
     result._rbf = _rbf;
     return result;
 }
Пример #7
0
 /// <summary>
 /// Construct RBF network.
 /// </summary>
 ///
 public RBFNetwork()
 {
     _flat = new FlatNetworkRBF();
 }
Пример #8
0
 public RBFNetwork()
 {
     this._flat = new FlatNetworkRBF();
 }