artlib.optimized.backends.torch.HypersphereARTMAP
Hypersphere ARTMAP (Torch-accelerated backend)
Classes
GPU-accelerated Hypersphere ARTMAP with export hooks for artlib |
|
HypersphereARTMAP for Classification. optimized with torch. |
Functions
|
Module Contents
- artlib.optimized.backends.torch.HypersphereARTMAP._to_device(x: torch.Tensor | numpy.ndarray, device, dtype=torch.float32) torch.Tensor
- class artlib.optimized.backends.torch.HypersphereARTMAP._TorchHypersphereARTMAPConfig
-
- dtype: torch.dtype = Ellipsis
- class artlib.optimized.backends.torch.HypersphereARTMAP._TorchHypersphereARTMAP(cfg: _TorchHypersphereARTMAPConfig)
Bases:
artlib.optimized.backends.torch._TorchSimpleARTMAP._TorchSimpleARTMAPGPU-accelerated Hypersphere ARTMAP with export hooks for artlib synchronization.
- cfg
- device
- dtype
- input_dim
- weight_dim
- _ensure_capacity()
- _prep_input(X: torch.Tensor) torch.Tensor
- _validate_prepared(X: torch.Tensor)
- _choice_and_match(I: torch.Tensor) Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]
Returns (T, m, I_radius, max_radius) 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]
- predict_ab_prepared(X_prepared: torch.Tensor | numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray]
- class artlib.optimized.backends.torch.HypersphereARTMAP.HypersphereARTMAP(rho: float, alpha: float, beta: float, r_hat: float, input_dim: int | None = None, device: str = 'cuda', dtype: torch.dtype = torch.float64, clamp_inputs: bool = False)
Bases:
artlib.supervised.SimpleARTMAP.SimpleARTMAPHypersphereARTMAP for Classification. optimized with torch.
This module implements HypersphereARTMAP
HypersphereARTMAP 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, HypersphereARTMAP behaves as a special case of
SimpleARTMAPinstantiated withHypersphereART.- _device = 'cuda'
- _dtype = Ellipsis
- _clamp = False
- _backend: _TorchHypersphereARTMAP | None = None
- _declared_input_dim = None
- _ensure_backend(X: numpy.ndarray)