Example #1
0
 /// <summary>
 /// Return the recommended gain value for the given nonlinearity function.
 /// </summary>
 public static double calculate_gain(NonlinearityType nonlinearity, double param = 0.0)
 {
     return(THSInit_calculate_gain((long)nonlinearity, param));
 }
Example #2
0
                /// <summary>
                /// Fills the input Tensor with values according to the method described in 'Delving deep into rectifiers: Surpassing human-level performance on ImageNet classification'
                /// </summary>
                public static Tensor kaiming_normal_(Tensor tensor, double a = 0, FanInOut mode = FanInOut.FanIn, NonlinearityType nonlinearity = NonlinearityType.LeakyReLU)
                {
                    var res = THSInit_kaiming_normal_(tensor.Handle, a, (long)mode, (long)nonlinearity);

                    if (res == IntPtr.Zero)
                    {
                        torch.CheckForErrors();
                    }
                    return(new Tensor(res));
                }