OverlapTilingStrategy#

class deepinv.distributed.strategies.OverlapTilingStrategy(img_size, tiling_dims=None, patch_size=256, overlap=32, stride=None, pad_mode='reflect', **kwargs)[source]#

Bases: DistributedSignalStrategy

Smart tiling strategy with padding for N-dimensional data.

This strategy:
  • Creates uniform patches with receptive field padding

  • Batches patches for efficient processing

  • Uses optimized tensor operations for reduction

Parameters:
  • img_size (Sequence[int]) – full shape of the signal tensor, including batch and channel dimensions (e.g., (B, C, H, W)).

  • tiling_dims (int | tuple[int, ...] | None) – dimensions to tile. - If None, defaults to last N dimensions where N is len(patch_size) if patch_size is tuple, else 2. - If int, tiles only that dimension. - If tuple, tiles specified dimensions.

  • patch_size (int | tuple[int, ...]) – size of each patch, supports non-cuboid patch size.

  • overlap (int | tuple[int, ...]) – padding radius around each patch, supports non-cuboid receptive field size.

  • stride (int | tuple[int, ...] | None) – stride between patches. Default to the same value as patch_size for non-overlapping patches.

  • pad_mode (str) – padding mode for edge patches.

get_local_patches(x, local_indices)[source]#

Extract and pad local patches.

get_num_patches()[source]#

Return total number of patches.

reduce_patches(out_tensor, local_pairs)[source]#

Reduce patches using tiling metadata.