コード例 #1
0
        /// <summary>1次元平均値逆プーリング</summary>
        public static VariableNode AverageUnpooling1D(VariableNode x, int stride, Shape outshape = null)
        {
            if (outshape == null)
            {
                int outwidth = x.Shape.Width * stride;

                outshape = Shape.Map1D(x.Shape.Channels, outwidth, x.Shape.Batch);
            }

            Function function =
                new Functions.Connection1D.AverageUnpooling(outshape, stride);

            VariableNode y = Apply(function, x)[0];

            return(y);
        }
コード例 #2
0
        /// <summary>1次元平均値逆プーリング</summary>
        public static Tensor AverageUnpooling1D(Tensor x, int stride, Shape outshape = null)
        {
            if (outshape == null)
            {
                int outwidth = x.Shape.Width * stride;

                outshape = Shape.Map1D(x.Shape.Channels, outwidth, x.Shape.Batch);
            }

            Function function =
                new Functions.Connection1D.AverageUnpooling(outshape, stride);

            Tensor y = new Tensor(function.OutputShapes(x.Shape)[0]);

            function.Execute(new Tensor[] { x }, new Tensor[] { y });

            return(y);
        }