Skip to content

Commit 371f23a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 49272c7 commit 371f23a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

neural_network/radial_basis_function_neural_network.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
"""
22
Radial Basis Function Neural Network (RBFNN)
33
4-
A Radial Basis Function Neural Network (RBFNN) is a type of artificial neural
5-
network that uses radial basis functions as activation functions.
6-
RBFNNs are particularly effective for function approximation, regression, and
7-
classification tasks. The architecture typically consists of an input layer,
4+
A Radial Basis Function Neural Network (RBFNN) is a type of artificial neural
5+
network that uses radial basis functions as activation functions.
6+
RBFNNs are particularly effective for function approximation, regression, and
7+
classification tasks. The architecture typically consists of an input layer,
88
a hidden layer with radial basis functions, and an output layer.
99
1010
In an RBFNN:
11-
- The hidden layer applies a radial basis function (often Gaussian) to the
11+
- The hidden layer applies a radial basis function (often Gaussian) to the
1212
input data, transforming it into a higher-dimensional space.
13-
- The output layer combines the results from the hidden layer using
13+
- The output layer combines the results from the hidden layer using
1414
weighted sums to produce the final output.
1515
1616
#### Reference
@@ -67,7 +67,7 @@ def _gaussian_rbf(self, input_vector: np.ndarray, center: np.ndarray) -> float:
6767
0.1353352832366127
6868
"""
6969
# Calculate the squared distances
70-
distances = np.linalg.norm(input_vector[:, np.newaxis] - center, axis=2)** 2
70+
distances = np.linalg.norm(input_vector[:, np.newaxis] - center, axis=2) ** 2
7171
return np.exp(-distances / (2 * self.spread**2))
7272

7373
def _compute_rbf_outputs(self, input_data: np.ndarray) -> np.ndarray:

0 commit comments

Comments
 (0)