Example #1
0
        public override bool Equals(object obj)
        {
            if (!(obj is NetworkSize))
            {
                return(false);
            }
            NetworkSize other = (NetworkSize)obj;

            if (InputLayerLength != other.InputLayerLength)
            {
                return(false);
            }
            if (OutputLayerLength != other.OutputLayerLength)
            {
                return(false);
            }
            for (int i = 0; i < InternalLayerCount; i++)
            {
                if (InternalLayerLengths[i] != other.InternalLayerLengths[i])
                {
                    return(false);
                }
            }
            return(true);
        }
Example #2
0
 public NetworkGradient(NetworkSize size)
 {
     this.weightAdditives = new WeightMatrix[size.InternalLayerCount - 1];
     this.biasAdditives   = new BiasVector[size.InternalLayerCount - 1];
     for (int index = 0; index < weightAdditives.Length; index++)
     {
         weightAdditives[index] = new WeightMatrix(size.InternalLayerLengths[index + 1], size.InternalLayerLengths[index]);
         biasAdditives[index]   = new BiasVector(index + 1);
     }
 }