Beispiel #1
0
        private LinearLayer(LinearLayer <T> other) : base(other)
        {
            _weights = other._weights.Clone();
            _bias    = other._bias.Clone();

            RegisterWeights(_bias, _weights);
        }
Beispiel #2
0
        public AffineLayer(BinaryReader reader)
        {
            var activationType = (AffineActivation)reader.ReadInt32();

            if (activationType == AffineActivation.None)
            {
                throw new InvalidOperationException("Invalid activation type loaded from file!");
            }

            _linearLayer     = new LinearLayer <T>(reader);
            _activationLayer = LoadAffineActivationLayer(activationType, reader);
        }
Beispiel #3
0
 public AffineLayer(AffineLayer <T> other) : base(other)
 {
     _activationType  = other._activationType;
     _linearLayer     = (LinearLayer <T>)other._linearLayer.Clone();
     _activationLayer = other._activationLayer.Clone();
 }
Beispiel #4
0
 public AffineLayer(int xSize, int ySize, AffineActivation activation, IMatrixInitializer <T> matrixInitializer)
 {
     _activationType  = activation;
     _linearLayer     = new LinearLayer <T>(xSize, ySize, matrixInitializer);
     _activationLayer = GetAffineActivationLayer(activation, ySize);
 }
Beispiel #5
0
 public AffineLayer(int xSize, int ySize, AffineActivation activation)
 {
     _activationType  = activation;
     _linearLayer     = new LinearLayer <T>(xSize, ySize);
     _activationLayer = GetAffineActivationLayer(activation, ySize);
 }