Exemple #1
0
        public Inception3(int classes = 1000, string prefix = "", ParameterDict @params = null) : base(prefix,
                                                                                                       @params)
        {
            Features = new HybridSequential("");
            Features.Add(Inception.MakeBasicConv(32, (3, 3), (2, 2)));
            Features.Add(Inception.MakeBasicConv(32, (3, 3)));
            Features.Add(Inception.MakeBasicConv(64, (3, 3), padding: (1, 1)));
            Features.Add(new MaxPool2D((3, 3), (2, 2)));
            Features.Add(Inception.MakeBasicConv(80, (1, 1)));
            Features.Add(Inception.MakeBasicConv(192, (3, 3)));
            Features.Add(new MaxPool2D((3, 3), (2, 2)));
            Features.Add(Inception.MakeA(32, "A1_"));
            Features.Add(Inception.MakeA(64, "A2_"));
            Features.Add(Inception.MakeA(64, "A3_"));
            Features.Add(Inception.MakeB("B_"));
            Features.Add(Inception.MakeC(128, "C1_"));
            Features.Add(Inception.MakeC(160, "C2_"));
            Features.Add(Inception.MakeC(160, "C3_"));
            Features.Add(Inception.MakeC(192, "C4_"));
            Features.Add(Inception.MakeD("D_"));
            Features.Add(Inception.MakeE("E1_"));
            Features.Add(Inception.MakeE("E2_"));
            Features.Add(new AvgPool2D((8, 8)));
            Features.Add(new Dropout(0.5f));
            RegisterChild(Features, "features");

            Output = new Dense(classes);
            RegisterChild(Output, "output");
        }