15
15
References:
16
16
1. Carpenter, G. A., & Grossberg, S. (1987). "A Adaptive Resonance Theory."
17
17
In: Neural Networks for Pattern Recognition, Oxford University Press,
18
- pp. 194–203.
18
+ pp.
19
19
2. Carpenter, G. A., & Grossberg, S. (1988). "The ART of Adaptive Pattern
20
20
Recognition by a Self-Organizing Neural Network." IEEE Transactions on
21
- Neural Networks, 1(2), 115-130. DOI: 10.1109/TNN.1988.82656
21
+ Neural Networks, 1(2) DOI: 10.1109/TNN.1988.82656
22
22
23
23
"""
24
24
@@ -34,7 +34,7 @@ class ART1:
34
34
num_features (int): Number of features in the input data.
35
35
vigilance (float): Threshold for similarity that determines whether
36
36
an input matches an existing cluster.
37
- weights (List[np.ndarray]): List of cluster weights representing the learned categories.
37
+ weights (List[np.ndarray]): List of cluster weights representing learned categories.
38
38
"""
39
39
40
40
def __init__ (self , num_features : int , vigilance : float = 0.7 ) -> None :
@@ -73,14 +73,13 @@ def _similarity(self, weight_vector: np.ndarray, input_vector: np.ndarray) -> fl
73
73
or len (input_vector ) != self .num_features
74
74
):
75
75
raise ValueError (
76
- "Both weight_vector and input_vector must have the same number of features."
76
+ "Both weight_vector and input_vector must have the same features."
77
77
)
78
78
79
79
return np .dot (weight_vector , input_vector ) / self .num_features
80
80
81
81
def _learn (
82
- self , w : np .ndarray , x : np .ndarray , learning_rate : float = 0.5
83
- ) -> np .ndarray :
82
+ self , w : np .ndarray , x : np .ndarray , learning_rate : float = 0.5 ) -> np .ndarray :
84
83
"""
85
84
Update cluster weights using the learning rate.
86
85
@@ -153,7 +152,7 @@ def art1_example() -> None:
153
152
"""
154
153
Example function demonstrating the usage of the ART1 model.
155
154
156
- This function creates a dataset, trains the ART1 model, and prints assigned clusters.
155
+ This function creates a dataset, trains the ART1 model, and prints clusters.
157
156
158
157
Examples:
159
158
>>> art1_example()
0 commit comments