nvidia.dali.fn.laplacian¶
- 
nvidia.dali.fn.laplacian(*inputs, **kwargs)¶
- Computes the Laplacian of an input. - The Laplacian is calculated as the sum of second order partial derivatives with respect to each spatial dimension. Each partial derivative is approximated with a separable convolution, that uses a derivative window in the direction of the partial derivative and smoothing windows in the remaining axes. - By default, each partial derivative is approximated by convolving along all spatial axes: the axis in partial derivative direction uses derivative window of - window_sizeand the remaining axes are convolved with smoothing windows of the same size. If- smoothing_sizeis specified, the smoothing windows applied to a given axis can have different size than the derivative window. Specifying- smoothing_size = 1implies no smoothing in axes perpendicular to the derivative direction.- Both - window_sizeand- smoothing_sizecan be specified as a single value or per axis. For example, for volumetric input, if- window_size=[dz, dy, dx]and- smoothing_size=[sz, sy, sx]are specified, the following windows will be used:- for partial derivative in - zdirection: derivative windows of size- dzalong- zaxis, and smoothing windows of size- syand- sxalong y and x respectively.
- for partial derivative in - ydirection: derivative windows of size- dyalong- yaxis, and smoothing windows of size- szand- sxalong z and x respectively.
- for partial derivative in - xdirection: derivative windows of size- dxalong- xaxis, and smoothing windows of size- szand- syalong z and y respectively.
 - Window sizes and smoothing sizes must be odd. The size of a derivative window must be at least 3. Smoothing window can be of size 1, which implies no smoothing along corresponding axis. - To normalize partial derivatives, - normalized_kernel=Truecan be used. Each partial derivative is scaled by- 2^(-s + n + 2), where- sis the sum of the window sizes used to calculate a given partial derivative (including the smoothing windows) and- nis the number of data dimensions/axes. Alternatively, you can specify- scaleargument to customize scaling factors. Scale can be either a single value or- nvalues, one for every partial derivative.- Operator uses 32-bit floats as an intermediate type. - Note - The channel - Cand frame- Fdimensions are not considered data axes. If channels are present, only channel-first or channel-last inputs are supported.- This operator allows sequence inputs and supports volumetric data. - Supported backends
- ‘cpu’ 
- ‘gpu’ 
 
 - Parameters
- input (TensorList) – Input to the operator. 
- Keyword Arguments
- bytes_per_sample_hint (int or list of int, optional, default = [0]) – - Output size hint, in bytes per sample. - If specified, the operator’s outputs residing in GPU or page-locked host memory will be preallocated to accommodate a batch of samples of this size. 
- dtype (nvidia.dali.types.DALIDataType, optional, default = DALIDataType.NO_TYPE) – - Output data type. - Supported type: FLOAT. If not set, the input type is used. 
- normalized_kernel (bool, optional, default = False) – If set to True, automatically scales partial derivatives kernels. Must be False if - scaleis specified.
- preserve (bool, optional, default = False) – Prevents the operator from being removed from the graph even if its outputs are not used. 
- scale (float or list of float or TensorList of float, optional, default = [1.0]) – - Factors to manually scale partial derivatives. - Supports - per-frameinputs.
- seed (int, optional, default = -1) – - Random seed. - If not provided, it will be populated based on the global seed of the pipeline. 
- smoothing_size (int or list of int or TensorList of int, optional) – - Size of smoothing window used in convolutions. - Smoothing size must be odd and between 1 and 23. - Supports - per-frameinputs.
- window_size (int or list of int or TensorList of int, optional, default = [3]) – - Size of derivative window used in convolutions. - Window size must be odd and between 3 and 23. - Supports - per-frameinputs.