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_size
and the remaining axes are convolved with smoothing windows of the same size. If smoothing_size
is specified, the smoothing windows applied to a given axis can have different size than the derivative window. Specifying smoothing_size = 1
implies no smoothing in axes perpendicular to the derivative direction.
Both window_size
and smoothing_size
can 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
z
direction: derivative windows of sizedz
alongz
axis, and smoothing windows of sizesy
andsx
along y and x respectively.for partial derivative in
y
direction: derivative windows of sizedy
alongy
axis, and smoothing windows of sizesz
andsx
along z and x respectively.for partial derivative in
x
direction: derivative windows of sizedx
alongx
axis, and smoothing windows of sizesz
andsy
along 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=True
can be used. Each partial derivative is scaled by 2^(-s + n + 2)
, where s
is the sum of the window sizes used to calculate a given partial derivative (including the smoothing windows) and n
is the number of data dimensions/axes. Alternatively, you can specify scale
argument to customize scaling factors. Scale can be either a single value or n
values, one for every partial derivative.
Operator uses 32-bit floats as an intermediate type.
Note
The channel C
and frame F
dimensions 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.
âcpuâ
âgpuâ
__input¶ (TensorList) â Input to the operator.
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) â
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 scale
is 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-frame
inputs.
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-frame
inputs.
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-frame
inputs.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4