Backends/SiaNet.Backend.MxNet/NDArrayOps.cs
/// <summary>
/// Computes 2D transposed convolution (aka fractionally strided convolution) of the input tensor. This operation can be seen as the gradient of Convolution operation with respect to its input. Convolution usually reduces the size of the input. Transposed convolution works the other way, going from a smaller input to a larger output while preserving the connectivity pattern.
/// </summary>
/// <param name="@out">output NDArray</param>
/// <param name="data">Input tensor to the deconvolution operation.</param>
/// <param name="kernel">Deconvolution kernel size: (h, w) or (d, h, w). This is same as the kernel size used for the corresponding convolution</param>
/// <param name="num_filter">Number of output filters.</param>
/// <param name="weight">Weights representing the kernel.</param>
/// <param name="bias">Bias added to the result after the deconvolution operation.</param>
/// <param name="stride">The stride used for the corresponding convolution: (h, w) or (d, h, w).</param>
/// <param name="dilate">Dilation factor for each dimension of the input: (h, w) or (d, h, w).</param>
/// <param name="pad">The amount of implicit zero padding added during convolution for each dimension of the input: (h, w) or (d, h, w). ``(kernel-1)/2`` is usually a good choice. If `target_shape` is set, `pad` will be ignored and a padding that will generate the target shape will be used.</param>
/// <param name="adj">Adjustment for output shape: (h, w) or (d, h, w). If `target_shape` is set, `adj` will be ignored and computed accordingly.</param>
/// <param name="target_shape">Shape of the output tensor: (h, w) or (d, h, w).</param>
/// <param name="num_group">Number of groups partition.</param>
/// <param name="workspace">Maximum temporal workspace allowed for deconvolution (MB).</param>
/// <param name="no_bias">Whether to disable bias parameter.</param>
/// <param name="cudnn_tune">Whether to pick convolution algorithm by running performance test.</param>
/// <param name="cudnn_off">Turn off cudnn for this layer.</param>
/// <param name="layout">Set layout for input, output and weight. Empty for default layout, NCW for 1d, NCHW for 2d and NCDHW for 3d.</param>
/// <returns>returns new symbol</returns>
Computes 2D transposed convolution (aka fractionally strided convolution) of the input tensor. This operation can be seen as the gradient of Convolution operation with respect to its input. Convolution usually reduces the size of the input. Transposed convolution works the other way, going from a smaller input to a larger output while preserving the connectivity pattern.
Computes 2D transposed convolution ( aka fractionally strided convolution ) of the input tensor . This operation can be seen as the gradient of Convolution operation with respect to its input . Convolution usually reduces the size of the input . Transposed convolution works the other way going from a smaller input to a larger output while preserving the connectivity pattern .
public static NDArray Deconvolution(NDArray @out,
        NDArray data,
        Shape kernel,
        uint num_filter,
        NDArray weight = null,
        NDArray bias = null,
        Shape stride = null,
        Shape dilate = null,
        Shape pad = null,
        Shape adj = null,
        Shape target_shape = null,
        uint num_group = 1,
        ulong workspace = 512,
        bool no_bias = true,
        DeconvolutionCudnnTune? cudnn_tune = null,
        bool cudnn_off = false,
        DeconvolutionLayout? layout = null)
        {
            return new Operator("Deconvolution")
            .SetParam("kernel", kernel)
            .SetParam("stride", stride)
            .SetParam("dilate", dilate)
            .SetParam("pad", pad)
            .SetParam("adj", adj)
            .SetParam("target_shape", target_shape)
            .SetParam("num_filter", num_filter)
            .SetParam("num_group", num_group)
            .SetParam("workspace", workspace)
            .SetParam("no_bias", no_bias)
            .SetParam("cudnn_tune", NDUtil.EnumToString<DeconvolutionCudnnTune>(cudnn_tune, DeconvolutionCudnnTuneConvert))
            .SetParam("cudnn_off", cudnn_off)
            .SetParam("layout", NDUtil.EnumToString<DeconvolutionLayout>(layout, DeconvolutionLayoutConvert))
            .SetInput("data", data)
            .SetInput("weight", weight)
            .SetInput("bias", bias)
            .Invoke(@out);
        }
public static NDArray Deconvolution ( NDArray @out , NDArray data , Shape kernel , uint num_filter , NDArray weight = null , NDArray bias = null , Shape stride = null , Shape dilate = null , Shape pad = null , Shape adj = null , Shape target_shape = null , uint num_group = 1 , ulong workspace = 512 , bool no_bias = true , DeconvolutionCudnnTune ? cudnn_tune = null , bool cudnn_off = false , DeconvolutionLayout ? layout = null ) { return new Operator ( " " ) . SetParam ( " " , kernel ) . SetParam ( " " , stride ) . SetParam ( " " , dilate ) . SetParam ( " " , pad ) . SetParam ( " " , adj ) . SetParam ( " " , target_shape ) . SetParam ( " " , num_filter ) . SetParam ( " " , num_group ) . SetParam ( " " , workspace ) . SetParam ( " " , no_bias ) . SetParam ( " " , NDUtil . EnumToString < DeconvolutionCudnnTune > ( cudnn_tune , DeconvolutionCudnnTuneConvert ) ) . SetParam ( " " , cudnn_off ) . SetParam ( " " , NDUtil . EnumToString < DeconvolutionLayout > ( layout , DeconvolutionLayoutConvert ) ) . SetInput ( " " , data ) . SetInput ( " " , weight ) . SetInput ( " " , bias ) . Invoke ( @out ) ; }
Computes 2D transposed convolution (aka fractionally strided convolution) of the input tensor.
Computes 2D transposed convolution ( aka fractionally strided convolution ) of the input tensor .
returns new symbol
returns new symbol
@out
NDArray
None
data
NDArray
Input tensor to the deconvolution operation.
Input tensor to the deconvolution operation .
kernel
Shape
Deconvolution kernel size: (h, w) or (d, h, w). This is same as the kernel size used for the corresponding convolution
Deconvolution kernel size : ( h w ) or ( d h w ) . This is same as the kernel size used for the corresponding convolution
num_filter
uint
Number of output filters.
Number of output filters .
weight
NDArray
Weights representing the kernel.
Weights representing the kernel .
bias
NDArray
Bias added to the result after the deconvolution operation.
Bias added to the result after the deconvolution operation .
stride
Shape
The stride used for the corresponding convolution: (h, w) or (d, h, w).
The stride used for the corresponding convolution : ( h w ) or ( d h w ) .
dilate
Shape
Dilation factor for each dimension of the input: (h, w) or (d, h, w).
Dilation factor for each dimension of the input : ( h w ) or ( d h w ) .
pad
Shape
The amount of implicit zero padding added during convolution for each dimension of the input: (h, w) or (d, h, w). ``(kernel-1)/2`` is usually a good choice. If `target_shape` is set, `pad` will be ignored and a padding that will generate the target shape will be used.
The amount of implicit zero padding added during convolution for each dimension of the input : ( h w ) or ( d h w ) . ` ` ( kernel - 1 ) / 2 ` ` is usually a good choice . If ` target_shape ` is set ` pad ` will be ignored and a padding that will generate the target shape will be used .
adj
Shape
Adjustment for output shape: (h, w) or (d, h, w). If `target_shape` is set, `adj` will be ignored and computed accordingly.
Adjustment for output shape : ( h w ) or ( d h w ) . If ` target_shape ` is set ` adj ` will be ignored and computed accordingly .
target_shape
Shape
Shape of the output tensor: (h, w) or (d, h, w).
Shape of the output tensor : ( h w ) or ( d h w ) .
num_group
uint
Number of groups partition.
Number of groups partition .
workspace
ulong
Maximum temporal workspace allowed for deconvolution (MB).
Maximum temporal workspace allowed for deconvolution ( MB ) .
no_bias
bool
Whether to disable bias parameter.
Whether to disable bias parameter .
cudnn_tune
DeconvolutionCudnnTune?
Whether to pick convolution algorithm by running performance test.
Whether to pick convolution algorithm by running performance test .
cudnn_off
bool
Turn off cudnn for this layer.
Turn off cudnn for this layer .
layout
DeconvolutionLayout?
Set layout for input, output and weight. Empty for default layout, NCW for 1d, NCHW for 2d and NCDHW for 3d.
Set layout for input output and weight . Empty for default layout NCW for 1d NCHW for 2d and NCDHW for 3d .