示例#1
0
        public void InnerProductLayer_Setup()
        {
            var config = new InnerProductLayerConfiguration(10);

            var layer = new InnerProductLayer(config);

            layer.Setup(bottom, top);

            Assert.Equal(2, top.Num);
            Assert.Equal(10, top.Channels);
            Assert.Equal(1, top.Height);
            Assert.Equal(1, top.Width);
        }
        public void InnerProductLayer_Forward()
        {
            var weightsFiller = new UniformFillerConfiguration(0, 1);
            var biasFiller = new UniformFillerConfiguration(1, 2);

            var config = new InnerProductLayerConfiguration(10, true, weightsFiller, biasFiller);

            var layer = new InnerProductLayer(config);
            layer.Setup(bottom, top);
            layer.Forward(bottom, top);

            using (var topCpu = top.OnCpu())
            {
                int count = top.Count;

                for (int i = 0; i < count; i++)
                    Assert.True(topCpu.DataAt(i) >= 1f);
            }
        }
示例#3
0
        public void InnerProductLayer_Forward()
        {
            var weightsFiller = new UniformFillerConfiguration(0, 1);
            var biasFiller    = new UniformFillerConfiguration(1, 2);

            var config = new InnerProductLayerConfiguration(10, true, weightsFiller, biasFiller);

            var layer = new InnerProductLayer(config);

            layer.Setup(bottom, top);
            layer.Forward(bottom, top);

            using (var topCpu = top.OnCpu())
            {
                int count = top.Count;

                for (int i = 0; i < count; i++)
                {
                    Assert.True(topCpu.DataAt(i) >= 1f);
                }
            }
        }
        public void InnerProductLayer_Setup()
        {
            var config = new InnerProductLayerConfiguration(10);

            var layer = new InnerProductLayer(config);
            layer.Setup(bottom, top);

            Assert.Equal(2, top.Num);
            Assert.Equal(10, top.Channels);
            Assert.Equal(1, top.Height);
            Assert.Equal(1, top.Width);
        }