public override void DoSigmoid(Volume <double> volume) { this.Storage.Map(x => 1.0 / (1.0 + Math.Exp(-x)), volume.Storage); }
public override void DoRelu(Volume <double> volume) { this.Storage.Map(x => x <= 0 ? 0 : x, volume.Storage); }
public override void DoReluGradient(Volume <double> input, Volume <double> outputGradient, Volume <double> inputGradient) { this.Storage.Map((x, y) => x > 0 ? y : 0, outputGradient.Storage, inputGradient.Storage); }
public override void DoNegate(Volume <double> volume) { DoMultiply(volume, -1.0); }
public override void DoMultiply(Volume <double> right, Volume <double> result) { this.Storage.MapEx((x, y) => x * y, right.Storage, result.Storage); }
public override void DoMultiply(Volume <double> result, double factor) { this.Storage.Map(x => x * factor, result.Storage); }
public override void DoLog(Volume <double> result) { this.Storage.Map(Math.Log, result.Storage); }
public override void DoExp(Volume <double> result) { this.Storage.Map(Math.Exp, result.Storage); }