LinSpacePerturbImageFactory

class nrtk.impls.perturb_image_factory.generic.linspace_step.LinSpacePerturbImageFactory(perturber: type[PerturbImage], theta_key: str, start: float, stop: float, step: int = 1, endpoint: bool = True)

Simple PerturbImageFactory implementation to step through the given range of values.

Methods

from_config

Instantiates a PerturbImageFactory from a configuration dictionary.

get_config

Returns the configuration of the factory instance.

get_default_config

Returns the default configuration for the PerturbImageFactory.

get_impls

Discover and return a set of classes that implement the calling class.

is_usable

Check whether this class is available for use.

__init__(perturber: type[PerturbImage], theta_key: str, start: float, stop: float, step: int = 1, endpoint: bool = True) None

Initialize the factory to produce PerturbImage instances of the given type.

Initialize the factory to produce PerturbImage instances of the given type, varying the given theta_key parameter from start to stop with given step.

Parameters:
  • perturber – Python implementation type of the PerturbImage interface to produce.

  • theta_key – Perturber parameter to vary between instances.

  • start – Initial value of desired range (inclusive).

  • stop – Final value of desired range (exclusive).

  • step – Number of instances to generate.

Raises:

TypeError – Given a perturber instance instead of type.

get_config() dict[str, Any]

Returns the configuration of the factory instance.

Returns:

dict[str, Any]: Configuration dictionary containing the perturber type and theta_key.

property thetas: Sequence[float]

Use linspace to generate the desired range of values.