Skip to content

random_patching_config

Random patching Pydantic model.

FixedRandomPatchingConfig #

Bases: _PatchedConfig

Fixed random patching Pydantic model.

Attributes:

Name Type Description
name fixed_random

The name of the patching strategy.

patch_size sequence of int

The size of the patch in each spatial dimension, each patch size must be a power of 2 and larger than 8.

Source code in src/careamics/config/data/patching_strategies/random_patching_config.py
class FixedRandomPatchingConfig(_PatchedConfig):
    """Fixed random patching Pydantic model.

    Attributes
    ----------
    name : "fixed_random"
        The name of the patching strategy.
    patch_size : sequence of int
        The size of the patch in each spatial dimension, each patch size must be a power
        of 2 and larger than 8.
    """

    name: Literal["fixed_random"] = "fixed_random"
    """The name of the patching strategy."""

    seed: int | None = Field(default=None, gt=0)
    """The random seed to use for patch sampling."""

name = 'fixed_random' class-attribute instance-attribute #

The name of the patching strategy.

seed = Field(default=None, gt=0) class-attribute instance-attribute #

The random seed to use for patch sampling.

RandomPatchingConfig #

Bases: _PatchedConfig

Random patching Pydantic model.

Attributes:

Name Type Description
name random

The name of the patching strategy.

patch_size sequence of int

The size of the patch in each spatial dimension, each patch size must be a power of 2 and larger than 8.

Source code in src/careamics/config/data/patching_strategies/random_patching_config.py
class RandomPatchingConfig(_PatchedConfig):
    """Random patching Pydantic model.

    Attributes
    ----------
    name : "random"
        The name of the patching strategy.
    patch_size : sequence of int
        The size of the patch in each spatial dimension, each patch size must be a power
        of 2 and larger than 8.
    """

    name: Literal["random"] = "random"
    """The name of the patching strategy."""

    seed: int | None = Field(default=None, gt=0)
    """Random seed for patch sampling, set to None for random seeding."""

name = 'random' class-attribute instance-attribute #

The name of the patching strategy.

seed = Field(default=None, gt=0) class-attribute instance-attribute #

Random seed for patch sampling, set to None for random seeding.