Class LibMatrixCuDNNPoolingDescriptors

  • All Implemented Interfaces:
    AutoCloseable

    public class LibMatrixCuDNNPoolingDescriptors
    extends Object
    implements AutoCloseable
    This class is a wrapper that contain necessary data structures to invoke a cudnn convolution* functions (such as cudnnConvolutionForward, etc) It implements autocloseable to simplify the LibMatrixCuDNN code and also avoids potential memory leaks.
    • Field Detail

      • xDesc

        public jcuda.jcudnn.cudnnTensorDescriptor xDesc
      • yDesc

        public jcuda.jcudnn.cudnnTensorDescriptor yDesc
      • dxDesc

        public jcuda.jcudnn.cudnnTensorDescriptor dxDesc
      • dyDesc

        public jcuda.jcudnn.cudnnTensorDescriptor dyDesc
      • poolingDesc

        public jcuda.jcudnn.cudnnPoolingDescriptor poolingDesc
    • Constructor Detail

      • LibMatrixCuDNNPoolingDescriptors

        public LibMatrixCuDNNPoolingDescriptors()
    • Method Detail

      • cudnnPoolingBackwardDescriptors

        public static LibMatrixCuDNNPoolingDescriptors cudnnPoolingBackwardDescriptors​(GPUContext gCtx,
                                                                                       String instName,
                                                                                       int N,
                                                                                       int C,
                                                                                       int H,
                                                                                       int W,
                                                                                       int K,
                                                                                       int R,
                                                                                       int S,
                                                                                       int pad_h,
                                                                                       int pad_w,
                                                                                       int stride_h,
                                                                                       int stride_w,
                                                                                       int P,
                                                                                       int Q,
                                                                                       LibMatrixDNN.PoolingType poolingType)
        Get descriptors for maxpooling backward operation
        Parameters:
        gCtx - gpu context
        instName - instruction name
        N - batch size
        C - number of channels
        H - height of image
        W - width of image
        K - number of filters
        R - height of filter
        S - width of filter
        pad_h - vertical padding
        pad_w - horizontal padding
        stride_h - horizontal stride
        stride_w - vertical stride
        P - (H - R + 1 + 2*pad_h)/stride_h
        Q - (W - S + 1 + 2*pad_w)/stride_w
        poolingType - type of pooling
        Returns:
        decriptor wrapper
      • cudnnPoolingDescriptors

        public static LibMatrixCuDNNPoolingDescriptors cudnnPoolingDescriptors​(GPUContext gCtx,
                                                                               String instName,
                                                                               int N,
                                                                               int C,
                                                                               int H,
                                                                               int W,
                                                                               int K,
                                                                               int R,
                                                                               int S,
                                                                               int pad_h,
                                                                               int pad_w,
                                                                               int stride_h,
                                                                               int stride_w,
                                                                               int P,
                                                                               int Q,
                                                                               LibMatrixDNN.PoolingType poolingType)
        Get descriptors for maxpooling operation
        Parameters:
        gCtx - gpu context
        instName - instruction name
        N - batch size
        C - number of channels
        H - height of image
        W - width of image
        K - number of filters
        R - height of filter
        S - width of filter
        pad_h - vertical padding
        pad_w - horizontal padding
        stride_h - horizontal stride
        stride_w - vertical stride
        P - (H - R + 1 + 2*pad_h)/stride_h
        Q - (W - S + 1 + 2*pad_w)/stride_w
        poolingType - type of pooling
        Returns:
        decriptor wrapper