/// <summary>2次元平均値逆プーリング</summary> public static VariableNode AverageUnpooling2D(VariableNode x, int stride, Shape outshape = null) { if (outshape == null) { int outwidth = x.Shape.Width * stride; int outheight = x.Shape.Height * stride; outshape = Shape.Map2D(x.Shape.Channels, outwidth, outheight, x.Shape.Batch); } Function function = new Functions.Connection2D.AverageUnpooling(outshape, stride); VariableNode y = Apply(function, x)[0]; return(y); }
/// <summary>2次元平均値逆プーリング</summary> public static Tensor AverageUnpooling2D(Tensor x, int stride, Shape outshape = null) { if (outshape == null) { int outwidth = x.Shape.Width * stride; int outheight = x.Shape.Height * stride; outshape = Shape.Map2D(x.Shape.Channels, outwidth, outheight, x.Shape.Batch); } Function function = new Functions.Connection2D.AverageUnpooling(outshape, stride); Tensor y = new Tensor(function.OutputShapes(x.Shape)[0]); function.Execute(new Tensor[] { x }, new Tensor[] { y }); return(y); }