Template
chore: adjust data format
Gitea Actions Experiment Test / Experiment-Actions (push) Successful in 13s
Gitea Actions Experiment Test / Experiment-Actions (push) Successful in 13s
This commit is contained in:
+34
-2
@@ -85,10 +85,42 @@ def img_to_vector(filename):
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 以下代码可用于测试,可自行随意修改
|
||||
|
||||
train_data, train_labels = load_dataset("trainingDigits")
|
||||
|
||||
test_data = "0000000000000011000000000000000000000000000011111000000000000000000000000000111111000000000000000000000000111111111000000000000000000000001111111110000000000000000000000011111111000000000000000000000001111111100000000000000000000000111111111000000000000000000000001111111100000000000000000000000011111111000000000000000000000000111111110000000000000000000000001111111100000000000000000000000011111110000000000000000000000001111111100000000000000000000000011111111000000000000000000000000111111110000000000000000000000001111111111111000000000000000000011111111111111110000000000000000111111111111111110000000000000011111111111111111110000000000000111111111111111111100000000000000111111111111111111000000000000001111111111111111110000000000000001111111111001111111000000000000011111111100011111110000000000000011111111001111111100000000000000111111111111111110000000000000000111111111111111100000000000000000111111111111111000000000000000000111111111111000000000000000000000111111111000000000000000000000000000111100000000000"
|
||||
test_data = (
|
||||
"00000000000000110000000000000000"
|
||||
"00000000000011111000000000000000"
|
||||
"00000000000011111100000000000000"
|
||||
"00000000001111111110000000000000"
|
||||
"00000000001111111110000000000000"
|
||||
"00000000001111111100000000000000"
|
||||
"00000000011111111000000000000000"
|
||||
"00000000111111111000000000000000"
|
||||
"00000000111111110000000000000000"
|
||||
"00000000111111110000000000000000"
|
||||
"00000000111111110000000000000000"
|
||||
"00000000111111110000000000000000"
|
||||
"00000000111111100000000000000000"
|
||||
"00000001111111100000000000000000"
|
||||
"00000001111111100000000000000000"
|
||||
"00000001111111100000000000000000"
|
||||
"00000001111111111111000000000000"
|
||||
"00000001111111111111111000000000"
|
||||
"00000001111111111111111100000000"
|
||||
"00000011111111111111111110000000"
|
||||
"00000011111111111111111110000000"
|
||||
"00000001111111111111111110000000"
|
||||
"00000001111111111111111110000000"
|
||||
"00000000111111111100111111100000"
|
||||
"00000000111111111000111111100000"
|
||||
"00000000011111111001111111100000"
|
||||
"00000000011111111111111111000000"
|
||||
"00000000001111111111111111000000"
|
||||
"00000000000111111111111111000000"
|
||||
"00000000000011111111111100000000"
|
||||
"00000000000001111111110000000000"
|
||||
"00000000000000000111100000000000"
|
||||
)
|
||||
predicted_label = classify(
|
||||
np.array([int(char) for char in test_data]).reshape(1, 1024),
|
||||
train_data,
|
||||
|
||||
Reference in New Issue
Block a user