pyhgf.model.conv.conv_patch_network#

pyhgf.model.conv.conv_patch_network(in_features, out_channels, key=None, strategy='he', leaf_kwargs=None, layer_kwargs=None, network_kwargs=None)[source]#

Build a fresh 2-layer DeepNetwork computing one conv kernel’s map.

Same shape as from_linear() (one weight matrix, bias folded in as the input layer’s constant node), initialised from key rather than copied from an existing layer. This network is the conv kernel itself, shared across every patch by DeepNetworkAdapter’s per-row batching.

Parameters:
  • in_features (int) – in_channels * kh * kw, the flattened patch size.

  • out_channels (int) – Number of output feature maps this kernel produces.

  • key (Array | None) – PRNG key for weight initialisation.

  • strategy (str) – Forwarded to DeepNetwork.weight_initialisation() (default "he", the scaling for the rectifier-style nonlinearity each conv block applies).

  • leaf_kwargs (dict | None) – Extra add_layer keyword arguments for the bottom (output) layer, such as the backprop-parity configuration.

  • layer_kwargs (dict | None) – Extra add_layer keyword arguments for the top (input) layer.

  • network_kwargs (dict | None) – Constructor arguments for the DeepNetwork itself, such as feedforward_uncertainty. These reach the network’s state when it is built and cannot be set afterwards, so they belong here rather than in the per-layer keyword sets.

Return type:

DeepNetwork