public void BackWard(Array <float> values) { var DE = _errorFunction.Error(_target.OutputVector, values); var DO = _activationFunction.Derivate(_target.SumVector); _target.ErrorVector = DE * DO; _target.ErrorWeightVector = NumMath.SumLine(_target.ErrorVector.W * _target.KnowlodgeMatrix); }
public double GetLoss(List <List <List <double> > > TargetData) { double loss = 0; for (int i = 0; i < TargetData.Count; i++) { //正向計算結果 double output = this.Forward(TrainData[i][0].ToArray())[0]; loss += errorFunction.Error(output, TrainData[i][1][0]); } return(loss / TargetData.Count); }