foolbox.models

Models

Model

PyTorchModel

TensorFlowModel

JAXModel

NumPyModel

Wrappers

TransformBoundsWrapper

Detailed description

class foolbox.models.Model
transform_bounds(bounds)

Returns a new model with the desired bounds and updates the preprocessing accordingly

Parameters

bounds (Union[foolbox.types.Bounds, Tuple[float, float]]) –

Return type

foolbox.models.base.Model

class foolbox.models.PyTorchModel(model, bounds, device=None, preprocessing=None)
Parameters
  • model (Any) –

  • bounds (Union[foolbox.types.Bounds, Tuple[float, float]]) –

  • device (Any) –

  • preprocessing (Optional[Dict[str, Any]]) –

class foolbox.models.TensorFlowModel(model, bounds, device=None, preprocessing=None)
Parameters
  • model (Any) –

  • bounds (Union[foolbox.types.Bounds, Tuple[float, float]]) –

  • device (Any) –

  • preprocessing (Optional[Dict[str, Any]]) –

class foolbox.models.JAXModel(model, bounds, preprocessing=None, data_format='channels_last')
Parameters
  • model (Any) –

  • bounds (Union[foolbox.types.Bounds, Tuple[float, float]]) –

  • preprocessing (Optional[Dict[str, Any]]) –

  • data_format (Optional[str]) –

class foolbox.models.NumPyModel(model, bounds, data_format=None)
Parameters
  • model (Callable) –

  • bounds (Union[foolbox.types.Bounds, Tuple[float, float]]) –

  • data_format (Optional[str]) –

class foolbox.models.TransformBoundsWrapper(model, bounds)
Parameters
transform_bounds(bounds, inplace=False)

Returns a new model with the desired bounds and updates the preprocessing accordingly

Parameters
Return type

foolbox.models.base.Model