artlib.optimized.backends.torch.FuzzyARTMAP
Fuzzy ARTMAP [8].
Classes
Torch accelerated Fuzzy ARTMAP with export hooks for artlib synchronization. |
|
FuzzyARTMAP for Classification. optimized with torch. |
Functions
|
|
|
Module Contents
- artlib.optimized.backends.torch.FuzzyARTMAP._to_device(x: torch.Tensor | numpy.ndarray, device, dtype=torch.float32) torch.Tensor
- artlib.optimized.backends.torch.FuzzyARTMAP._complement_code(x: torch.Tensor) torch.Tensor
- class artlib.optimized.backends.torch.FuzzyARTMAP._TorchFuzzyARTMAPConfig
-
- dtype: torch.dtype = Ellipsis
- class artlib.optimized.backends.torch.FuzzyARTMAP._TorchFuzzyARTMAP(cfg: _TorchFuzzyARTMAPConfig)
Torch accelerated Fuzzy ARTMAP with export hooks for artlib synchronization.
- cfg
- device
- dtype
- input_dim
- code_dim
- _ensure_capacity()
- _validate_prepared(X: torch.Tensor)
- set_data_bounds(lower: torch.Tensor | numpy.ndarray, upper: torch.Tensor | numpy.ndarray)
- prepare_data(X: torch.Tensor | numpy.ndarray) torch.Tensor
- _choice_and_match(I: torch.Tensor) Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]
Returns (T, m, I_sum, IandW_sum) for a single prepared input I.
- partial_fit_and_export(X_prepared: torch.Tensor | numpy.ndarray, y: torch.Tensor | numpy.ndarray, epsilon: float = 1e-10, match_tracking: Literal['MT+', 'MT-', 'MT0', 'MT1', 'MT~'] = 'MT+') Tuple[numpy.ndarray, list[numpy.ndarray], numpy.ndarray]
Incremental training on already-prepared inputs.
Returns: labels_a_out (np.ndarray): per-sample chosen A-side category indices weights_arrays (list[np.ndarray]): per-category weights (float64) cluster_labels_out (np.ndarray): map from A categories to B labels
- predict_ab_prepared(X_prepared: torch.Tensor | numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray]
- class artlib.optimized.backends.torch.FuzzyARTMAP.FuzzyARTMAP(rho: float, alpha: float, beta: float, input_dim: int | None = None, device: str = 'cuda', dtype: torch.dtype = torch.float64)
Bases:
artlib.optimized.backends.torch._TorchSimpleARTMAP._TorchSimpleARTMAPFuzzyARTMAP for Classification. optimized with torch.
This module implements FuzzyARTMAP
FuzzyARTMAP is a non-modular classification model which has been highly optimized for run-time performance. Fit and predict functions are implemented in torch for efficient execution. This class acts as a wrapper for the underlying torch functions and to provide compatibility with the artlib style and usage. Functionally, FuzzyARTMAP behaves as a special case of
SimpleARTMAPinstantiated withFuzzyART.- _device = 'cuda'
- _dtype = Ellipsis
- _backend: _TorchFuzzyARTMAP | None = None
- _declared_input_dim = None
- _ensure_backend(X: numpy.ndarray)