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