Ejemplo n.º 1
0
        public void TestTrainValDeserialize()
        {
            var net = ProtoConvert.DeserializeObject <NetParameter>(File.ReadAllText(@"bvlc_googlenet\train_val.prototxt"));

            Assert.IsNotNull(net);
            Assert.AreEqual(166, net.Layer.Count);
            Assert.AreEqual(117, net.Layer[0].TransformParam.MeanValue[1]);
            Assert.AreEqual(Phase.TEST, net.Layer[1].Include[0].Phase);
        }
Ejemplo n.º 2
0
        public void TestSolverDeserialize()
        {
            var solve = ProtoConvert.DeserializeObject <SolverParameter>(File.ReadAllText(@"bvlc_googlenet\solver.prototxt"));

            Assert.IsNotNull(solve);
            Assert.AreEqual(40, solve.AverageLoss);
            Assert.AreEqual(false, solve.TestInitialization);
            Assert.AreEqual(320000, solve.Stepsize);
            Assert.AreEqual(SolverParameter.SolverMode.GPU, solve.solver_mode);
        }
Ejemplo n.º 3
0
        public void TestQuickSolverDeserialize()
        {
            var solve = ProtoConvert.DeserializeObject <SolverParameter>(File.ReadAllText(@"bvlc_googlenet\quick_solver.prototxt"));

            Assert.IsNotNull(solve);
            Assert.AreEqual(1000, solve.TestIter[0]);
            Assert.AreEqual("poly", solve.LrPolicy);
            Assert.AreEqual("models/bvlc_googlenet/bvlc_googlenet_quick", solve.SnapshotPrefix);
            Assert.AreEqual(SolverParameter.SolverMode.GPU, solve.solver_mode);
        }
Ejemplo n.º 4
0
        public void TestSolverDeserialize()
        {
            var solve = ProtoConvert.DeserializeObject <SolverParameter>(File.ReadAllText(@"flickr\solver.prototxt"));

            Assert.IsNotNull(solve);
            Assert.AreEqual(20000, solve.Stepsize);
            Assert.AreEqual(20, solve.Display);
            Assert.AreEqual(0.0005f, solve.WeightDecay);
            Assert.AreEqual("models/finetune_flickr_style/finetune_flickr_style", solve.SnapshotPrefix);
        }
Ejemplo n.º 5
0
        public void TestTrainValDeserialize()
        {
            var net = ProtoConvert.DeserializeObject <NetParameter>(File.ReadAllText(@"flickr\train_val.prototxt"));

            Assert.IsNotNull(net);
            Assert.AreEqual(26, net.Layer.Count);
            Assert.AreEqual("data/ilsvrc12/imagenet_mean.binaryproto", net.Layer[0].TransformParam.MeanFile);
            Assert.AreEqual(256u, net.Layer[1].ImageDataParam.NewHeight);
            Assert.AreEqual(Phase.TEST, net.Layer[24].Include[0].Phase);
            Assert.AreEqual("gaussian", net.Layer[23].InnerProductParam.WeightFiller.Type);
        }
Ejemplo n.º 6
0
        public void TestDeployDeserialize()
        {
            var net = ProtoConvert.DeserializeObject <NetParameter>(File.ReadAllText(@"bvlc_googlenet\deploy.prototxt"));

            Assert.IsNotNull(net);
            Assert.IsNotNull(net.Input);
            Assert.AreEqual("data", net.Input[0]);
            Assert.AreEqual(10, net.InputShape[0].Dim[0]);
            Assert.AreEqual(2, net.Layer[0].Param[1].LrMult);
            Assert.AreEqual("xavier", net.Layer[0].ConvolutionParam.WeightFiller.Type);
            Assert.AreEqual("loss3/classifier", net.Layer.Last().Bottom[0]);
        }
Ejemplo n.º 7
0
        public void TestDeployDeserialize()
        {
            var net = ProtoConvert.DeserializeObject <NetParameter>(File.ReadAllText(@"flickr\deploy.prototxt"));

            Assert.IsNotNull(net);
            Assert.IsNotNull(net.Input);
            Assert.AreEqual("data", net.Input[0]);
            Assert.AreEqual(10, net.InputShape[0].Dim[0]);
            Assert.AreEqual(1, net.Layer[0].Param[0].LrMult);
            Assert.AreEqual("gaussian", net.Layer[0].ConvolutionParam.WeightFiller.Type);
            Assert.AreEqual("prob", net.Layer.Last().Name);
        }