Esempio n. 1
0
 public static Symbol Pooling(Symbol data,
                              Shape kernel,
                              PoolingPoolType poolType,
                              bool globalPool = false,
                              bool cudnnOff   = false,
                              PoolingPoolingConvention poolingConvention = PoolingPoolingConvention.Valid)
 {
     return(Pooling(data, kernel, poolType, globalPool, cudnnOff, poolingConvention, new Shape()));
 }
Esempio n. 2
0
 public static Symbol Pooling(Symbol data,
                              Shape kernel,
                              PoolingPoolType poolType,
                              bool globalPool,
                              bool cudnnOff,
                              PoolingPoolingConvention poolingConvention,
                              Shape stride)
 {
     return(Pooling(data, kernel, poolType, globalPool, cudnnOff, poolingConvention, stride, new Shape()));
 }
Esempio n. 3
0
 public static Symbol Pooling(Symbol data,
                              Shape kernel,
                              PoolingPoolType poolType,
                              bool globalPool,
                              bool cudnnOff,
                              PoolingPoolingConvention poolingConvention,
                              Shape stride,
                              Shape pad)
 {
     return(new Operator("Pooling").SetParam("kernel", kernel)
            .SetParam("pool_type", PoolingPoolTypeValues[(int)poolType])
            .SetParam("global_pool", globalPool)
            .SetParam("cudnn_off", cudnnOff)
            .SetParam("pooling_convention", PoolingPoolingConventionValues[(int)poolingConvention])
            .SetParam("stride", stride)
            .SetParam("pad", pad)
            .SetInput("data", data)
            .CreateSymbol());
 }
Esempio n. 4
0
        private static Symbol InceptionFactory(Symbol data,
                                               int num_1x1,
                                               int num_3x3red,
                                               int num_3x3,
                                               int num_d5x5red,
                                               int num_d5x5,
                                               PoolingPoolType pool,
                                               int proj,
                                               string name)
        {
            var c1x1 = ConvFactory(data, num_1x1, new Shape(1, 1),
                                   new Shape(1, 1), new Shape(0, 0), name + "_1x1");

            var c3x3r = ConvFactory(data, num_3x3red, new Shape(1, 1),
                                    new Shape(1, 1), new Shape(0, 0), name + "_3x3", "_reduce");

            var c3x3 = ConvFactory(c3x3r, num_3x3, new Shape(3, 3),
                                   new Shape(1, 1), new Shape(1, 1), name + "_3x3");

            var cd5x5r = ConvFactory(data, num_d5x5red, new Shape(1, 1),
                                     new Shape(1, 1), new Shape(0, 0), name + "_5x5", "_reduce");

            var cd5x5 = ConvFactory(cd5x5r, num_d5x5, new Shape(5, 5),
                                    new Shape(1, 1), new Shape(2, 2), name + "_5x5");

            var pooling = Operators.Pooling(name + "_pool", data, new Shape(3, 3), pool,
                                            false, false, PoolingPoolingConvention.Valid,
                                            new Shape(1, 1), new Shape(1, 1));

            var cproj = ConvFactory(pooling, proj, new Shape(1, 1),
                                    new Shape(1, 1), new Shape(0, 0), name + "_proj");

            var lst = new List <Symbol>();

            lst.Add(c1x1);
            lst.Add(c3x3);
            lst.Add(cd5x5);
            lst.Add(cproj);
            return(Operators.Concat("ch_concat_" + name + "_chconcat", lst, lst.Count));
        }
Esempio n. 5
0
        private static Symbol InceptionFactoryA(Symbol data,
                                                int num_1x1,
                                                int num_3x3red,
                                                int num_3x3,
                                                int num_d3x3red,
                                                int num_d3x3,
                                                PoolingPoolType pool,
                                                int proj,
                                                string name)
        {
            var c1x1 = ConvFactoryBN(data, num_1x1, new Shape(1, 1), new Shape(1, 1),
                                     new Shape(0, 0), name + "1x1");
            var c3x3r = ConvFactoryBN(data, num_3x3red, new Shape(1, 1), new Shape(1, 1),
                                      new Shape(0, 0), name + "_3x3r");
            var c3x3 = ConvFactoryBN(c3x3r, num_3x3, new Shape(3, 3), new Shape(1, 1),
                                     new Shape(1, 1), name + "_3x3");
            var cd3x3r = ConvFactoryBN(data, num_d3x3red, new Shape(1, 1), new Shape(1, 1),
                                       new Shape(0, 0), name + "_double_3x3", "_reduce");
            var cd3x3 = ConvFactoryBN(cd3x3r, num_d3x3, new Shape(3, 3), new Shape(1, 1),
                                      new Shape(1, 1), name + "_double_3x3_0");

            cd3x3 = ConvFactoryBN(cd3x3, num_d3x3, new Shape(3, 3), new Shape(1, 1),
                                  new Shape(1, 1), name + "_double_3x3_1");
            var pooling = Operators.Pooling(name + "_pool", data,
                                            new Shape(3, 3), pool, false, false,
                                            PoolingPoolingConvention.Valid,
                                            new Shape(1, 1), new Shape(1, 1));
            var cproj = ConvFactoryBN(pooling, proj, new Shape(1, 1), new Shape(1, 1),
                                      new Shape(0, 0), name + "_proj");

            var lst = new List <Symbol>();

            lst.Add(c1x1);
            lst.Add(c3x3);
            lst.Add(cd3x3);
            lst.Add(cproj);
            return(Operators.Concat($"ch_concat_{name}_chconcat", lst, lst.Count));
        }
Esempio n. 6
0
 public GlobalPooling3D(PoolingPoolType poolingType)
     : base("globalpooling3d")
 {
     PoolingType = poolingType;
 }