artlib.elementary.ART2 ====================== .. py:module:: artlib.elementary.ART2 .. autoapi-nested-parse:: ART2 :cite:`carpenter1987art`, :cite:`carpenter1991art`. :: ================================================================== DISCLAIMER: DO NOT USE ART2!!! IT DOES NOT WORK It is provided for completeness only. Stephan Grossberg himself has said ART2 does not work. ================================================================== Classes ------- .. autoapisummary:: artlib.elementary.ART2.ART2A Module Contents --------------- .. py:class:: ART2A(rho: float, alpha: float, beta: float) Bases: :py:obj:`artlib.common.BaseART.BaseART` ART2-A for Clustering. This module implements ART2-A as first published in: :cite:`carpenter1987art`, :cite:`carpenter1991art` .. # Carpenter, G. A., & Grossberg, S. (1987b). .. # ART 2: self-organization of stable category recognition codes for analog input .. # patterns. .. # Appl. Opt., 26, 4919–4930. doi:10.1364/AO.26.004919. .. # Carpenter, G. A., Grossberg, S., & Rosen, D. B. (1991b). .. # ART 2-A: An adaptive resonance algorithm for rapid category learning and .. # recognition. .. # Neural Networks, 4, 493 – 504. doi:10.1016/0893-6080(91) 90045-7. ART2-A is similar to :class:`~artlib.elementary.ART1.ART1` but designed for analog data. This method is implemented for historical purposes and is not recommended for use. .. py:method:: validate_params(params: dict) :staticmethod: Validate clustering parameters. :param params: Dictionary containing parameters for the algorithm. :type params: dict .. py:method:: check_dimensions(X: numpy.ndarray) Check that the data has the correct dimensions. :param X: The dataset. :type X: np.ndarray .. py:method:: category_choice(i: numpy.ndarray, w: numpy.ndarray, params: dict) -> tuple[float, Optional[dict]] Get the activation of the cluster. :param i: Data sample. :type i: np.ndarray :param w: Cluster weight or information. :type w: np.ndarray :param params: Dictionary containing parameters for the algorithm. :type params: dict :returns: * *float* -- Cluster activation. * *dict, optional* -- Cache used for later processing. .. py:method:: match_criterion(i: numpy.ndarray, w: numpy.ndarray, params: dict, cache: Optional[dict] = None) -> tuple[float, Optional[dict]] Get the match criterion of the cluster. :param i: Data sample. :type i: np.ndarray :param w: Cluster weight or information. :type w: np.ndarray :param params: Dictionary containing parameters for the algorithm. :type params: dict :param cache: Cache containing values from previous calculations. :type cache: dict, optional :returns: * *float* -- Cluster match criterion. * *dict* -- Cache used for later processing. .. py:method:: update(i: numpy.ndarray, w: numpy.ndarray, params: dict, cache: Optional[dict] = None) -> numpy.ndarray Get the updated cluster weight. :param i: Data sample. :type i: np.ndarray :param w: Cluster weight or information. :type w: np.ndarray :param params: Dictionary containing parameters for the algorithm. :type params: dict :param cache: Cache containing values from previous calculations. :type cache: dict, optional :returns: Updated cluster weight. :rtype: np.ndarray .. py:method:: new_weight(i: numpy.ndarray, params: dict) -> numpy.ndarray Generate a new cluster weight. :param i: Data sample. :type i: np.ndarray :param params: Dictionary containing parameters for the algorithm. :type params: dict :returns: Updated cluster weight. :rtype: np.ndarray .. py:method:: get_cluster_centers() -> List[numpy.ndarray] Get the centers of each cluster, used for regression. :returns: Cluster centroids. :rtype: list of np.ndarray