netket.nn.MaskedConv2D#

class netket.nn.MaskedConv2D[source]#

Bases: Module

2D convolution module with mask for autoregressive NN.

Attributes
feature_group_count: int = 1#

1).

Type:

if specified, divides the input features into groups (default

precision: Any = None#

numerical precision of the computation, see jax.lax.Precision for details.

use_bias: bool = True#

True).

Type:

whether to add a bias to the output (default

features: int#

number of convolution filters.

kernel_size: tuple[int, int]#

shape of the convolutional kernel (h, w). Typically, h = w // 2 + 1.

kernel_dilation: tuple[int, int]#

a sequence of 2 integers, giving the dilation factor to apply in each spatial dimension of the convolution kernel.

exclusive: bool#

True if an output element does not depend on the input element at the same index.

kernel_init: Callable[[Any, Sequence[int], Any], Union[ndarray, Array]]#

initializer for the convolutional kernel.

bias_init: Callable[[Any, Sequence[int], Any], Union[ndarray, Array]]#

initializer for the bias.

Methods
__call__(inputs)[source]#

Applies a masked convolution to the inputs.

Parameters:

inputs (Union[ndarray, Array]) – input data with dimensions (batch, width, height, features).

Return type:

Union[ndarray, Array]

Returns:

The convolved data.