Пример #1
0
        public override void InitWeight(string name, ref NDArray arr)
        {
            arr.Constant(0);
            var num_hidden = Convert.ToInt32(arr.Shape[0] / 4);
            var data       = arr.GetValues <float>();

            for (var i = num_hidden; i < 2 * num_hidden; i++)
            {
                data[i] = ForgetBias;
            }

            arr.SyncCopyFromCPU(data);
        }
Пример #2
0
 public override void InitWeight(string name, ref NDArray arr)
 {
     arr.Constant(1);
 }
Пример #3
0
 public override void Generate(NDArray x)
 {
     x.Constant(this.Value);
 }