Kohnen Network使用@alexarnimueller所撰寫的Source Code
Source Code Ref: Kohonen, T. Self-Organized Formation of Topologically Correct Feature Maps. Biol. Cybern. 1982, 43 (1), 59–69.
進行資料特徵歸一化,為了更佳的分群效果
def feature_normalization(X):
count_featrue = X.shape[-1]
f_maxs = []
f_mins = []
for i in range(count_featrue):
f_max = np.max(X[:,[i]])
f_min = np.min(X[:,[i]])
f_maxs.append(f_max)
f_mins.append(f_min)
for i in range(len(X)):
x_normalizatoion = np.array([0.0]*13)
for j in range(len(X[i])):
f_max = f_maxs[j]
f_min = f_mins[j]
x_normalizatoion[j] = (X[i][j] - f_min)/(f_max - f_min)
X[i] = x_normalizatoion
return X
- network size : 8*8
- epoch : 10000
- learning rate :
lr = 1 / (1 + (epoch / 0.5) **4)