Esempio n. 1
0
 public override void DoSigmoid(Volume <double> volume)
 {
     this.Storage.Map(x => 1.0 / (1.0 + Math.Exp(-x)), volume.Storage);
 }
Esempio n. 2
0
 public override void DoRelu(Volume <double> volume)
 {
     this.Storage.Map(x => x <= 0 ? 0 : x, volume.Storage);
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
 public override void DoNegate(Volume <double> volume)
 {
     DoMultiply(volume, -1.0);
 }
Esempio n. 5
0
 public override void DoMultiply(Volume <double> right, Volume <double> result)
 {
     this.Storage.MapEx((x, y) => x * y, right.Storage, result.Storage);
 }
Esempio n. 6
0
 public override void DoMultiply(Volume <double> result, double factor)
 {
     this.Storage.Map(x => x * factor, result.Storage);
 }
Esempio n. 7
0
 public override void DoLog(Volume <double> result)
 {
     this.Storage.Map(Math.Log, result.Storage);
 }
Esempio n. 8
0
 public override void DoExp(Volume <double> result)
 {
     this.Storage.Map(Math.Exp, result.Storage);
 }