Esempio n. 1
0
 public Data(ShapedArray <double> inputs, ShapedArray <double> targets)
 {
     Inputs      = inputs;
     Targets     = targets;
     InputShape  = inputs.Shape;
     TargetShape = targets.Shape;
 }
Esempio n. 2
0
        public ShapedArray <double> Predict(ShapedArray <double> inputs)
        {
            if (inputs.Shape != InputShape)
            {
                throw new ShapeMismatchException(nameof(inputs));
            }

            Forward(inputs, false);
            return(GetOutput());
        }
Esempio n. 3
0
 protected abstract void CalcGrads(ILoss loss, ShapedArray <double> targets);
Esempio n. 4
0
 protected abstract void Forward(ShapedArray <double> inputs, bool isTraining);
Esempio n. 5
0
 public ShapedArray <T> ToShape(Shape shape)
 {
     return(ShapedArray <T> .FromRef(shape, internalArray));
 }