protected override void OnInit() { base.OnInit(); Kernels = new Tensor(new Shape(FilterSize, FilterSize, InputShape.Depth, FiltersNum)); Bias = new Tensor(new Shape(OutputShape.Width, OutputShape.Height, FiltersNum)); KernelsGradient = new Tensor(Kernels.Shape); BiasGradient = new Tensor(Bias.Shape); KernelInitializer.Init(Kernels, InputShapes[0].Length, OutputShape.Length); if (UseBias) { BiasInitializer.Init(Bias, InputShapes[0].Length, OutputShape.Length); } }
protected override void OnInit() { base.OnInit(); Weights = new Tensor(new Shape(InputShape.Length, OutputShape.Length)); Bias = new Tensor(OutputShape); WeightsGradient = new Tensor(Weights.Shape); BiasGradient = new Tensor(Bias.Shape); KernelInitializer.Init(Weights, InputShape.Length, OutputShape.Length); if (UseBias) { BiasInitializer.Init(Bias, InputShape.Length, OutputShape.Length); } }