Deep learning for NeuroImaging in Python.
Note
This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the gallery for the big picture.
- class nidl.transforms.MultiViewsTransform(transforms: Callable | Sequence[Callable], n_views: int | None = None, **kwargs)[source]¶
Bases:
Transform
Multi-views transformation.
It generates several “views” of the same input data, i.e. it applies transformations (usually stochastic) multiple times to the input.
- Parameters:
transforms : Callable or Sequence of Callable
Transformation or sequence of transformations to be applied. If a single transform is given, it generates n_views of the same input using the same transformation applied n_views times. If a sequence is given, it applies this sequence of transforms to the input in the same order.
n_views : int or None, default=None
Number of views to generate if transforms is a Transform. If n_views != 1 and transforms is a sequence, a ValueError is raised. If None, it is set to 1 if transforms is a Transform and ignored otherwise.
kwargs : dict
Additional keyword arguments given to Transform.
- Returns:
data : list of array or torch.Tensor
List of transformed data.
Notes
The data are not parsed by this transformation. It should be handled elsewhere.
- apply_transform(x: Any, **kwargs) list[ndarray | Tensor] [source]¶
Apply the transformation on the data parsed by
parse_data()
. This should be implemented in all subclasses.- Parameters:
data_parsed : Any
Input data with type and shape already checked.
*args : Any
Additional positional arguments.
**kwargs : dict
Additional keyword arguments.
- Returns:
data : Any
The transformed data.
Follow us