We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 069b5d4 commit 4e5e20eCopy full SHA for 4e5e20e
unsupervised_class/neural_kmeans.py
@@ -4,21 +4,24 @@
4
from sklearn.preprocessing import StandardScaler
5
6
7
+# get the data and standardize it
8
X = get_simple_data()
9
scaler = StandardScaler()
10
X = scaler.fit_transform(X)
11
12
+# get shapes
13
N, D = X.shape
14
K = 3
15
16
+# initialize parameters
17
W = np.random.randn(D, K)
18
-
19
+# set hyperparameters
20
n_epochs = 100
21
learning_rate = 0.001
22
losses = []
23
24
+# training loop
25
for i in range(n_epochs):
26
loss = 0
27
for j in range(N):
0 commit comments