public Vol Forward(Vol V, bool is_training) { this.in_Act = V; var A = V.CloneAndZero(); this.S_cache_ = V.CloneAndZero(); var n2 = Math.Floor(this.n / 2); LRN(V, A, n2); this.Output = A; return(this.Output); // dummy identity function for now }
public Vol Forward(Vol V, bool is_training) { this.input = V; var V2 = V.CloneAndZero(); var N = V.W.Length; var V2w = V2.W; var Vw = V.W; for (var i = 0; i < N; i++) { V2w[i] = (float)Math.Tanh(Vw[i]); } this.Output = V2; return(this.Output); }
public Vol Forward(Vol V, bool is_training) { this.in_Act = V; var V2 = V.CloneAndZero(); var N = V.W.Length; var V2w = V2.W; var Vw = V.W; for (var i = 0; i < N; i++) { V2w[i] = 1.0 / (1.0 + Math.Exp(-Vw[i])); } this.Output = V2; return(this.Output); }