Exemplo n.º 1
0
        static bool FullConnTest()
        {
            FullyConnLayar layer = new FullyConnLayar(new Relu(), new Size(10, 10, 3));

            layer.Compile(new Size(10, 10, 3));

            double[,,] input  = new double[10, 10, 3];
            double[,,] output = layer.GetOutput(input);

            for (int x = 0; x < 3; x++)
            {
                for (int y = 0; y < 10; y++)
                {
                    for (int z = 0; z < 10; z++)
                    {
                        if (output[z, y, x] != input[z, y, x])
                        {
                            return(false);
                        }
                    }
                }
            }

            return(true);
        }
Exemplo n.º 2
0
        public override void Compile(Size[] input_sizes)
        {
            base.Compile(input_sizes);

            layers = new FullyConnLayar[input_sizes.Length, output_sizes.Length];
            for (int i = 0; i < input_sizes.Length; i++)
            {
                for (int j = 0; j < output_sizes.Length; j++)
                {
                    layers[i, j] = new FullyConnLayar(new SimpleFunc(), output_sizes[j]);
                    layers[i, j].Compile(input_sizes[i]);
                    layers[i, j].AddNoise();
                }
            }
        }