예제 #1
0
        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);
            }
        }
예제 #2
0
파일: Dense.cs 프로젝트: uzbekdev1/Neuro
        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);
            }
        }