Skip to content

Commit 4e5e20e

Browse files
committed
add some comments
1 parent 069b5d4 commit 4e5e20e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

unsupervised_class/neural_kmeans.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,24 @@
44
from sklearn.preprocessing import StandardScaler
55

66

7+
# get the data and standardize it
78
X = get_simple_data()
89
scaler = StandardScaler()
910
X = scaler.fit_transform(X)
1011

12+
# get shapes
1113
N, D = X.shape
1214
K = 3
1315

16+
# initialize parameters
1417
W = np.random.randn(D, K)
1518

16-
19+
# set hyperparameters
1720
n_epochs = 100
1821
learning_rate = 0.001
1922
losses = []
2023

21-
24+
# training loop
2225
for i in range(n_epochs):
2326
loss = 0
2427
for j in range(N):

0 commit comments

Comments
 (0)