更新 function.py
Gitea Actions Experiment Test / Experiment-Actions (push) Successful in 30s

This commit is contained in:
cy
2024-10-20 15:49:20 +08:00
parent 977f6851a6
commit 7b4da92f80
+6
View File
@@ -146,6 +146,12 @@ if __name__ == "__main__":
"00000000000001111111110000000000"
"00000000000000000111100000000000"
)
# 对测试数据进行归一化
test_data_vector = np.array([int(char) for char in test_data]).reshape(1, 1024)
test_data_min = np.min(test_data_vector)
test_data_max = np.max(test_data_vector)
test_data_vector = (test_data_vector - test_data_min) / (test_data_max - test_data_min)
predicted_label = classify(
np.array([int(char) for char in test_data]).reshape(1, 1024),
train_data,