質問編集履歴
1
accuracyとlossの計算方法を記載
test
CHANGED
File without changes
|
test
CHANGED
@@ -39,3 +39,43 @@
|
|
39
39
|
[ 30 405 319]]
|
40
40
|
|
41
41
|
```
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
また、accuracyとlossは以下のように計算しました。
|
46
|
+
|
47
|
+
```ここに言語を入力
|
48
|
+
|
49
|
+
#data generate
|
50
|
+
|
51
|
+
test_datagen=ImageDataGenerator(rescale=1.0/255)
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
test_generator=test_datagen.flow_from_directory(
|
56
|
+
|
57
|
+
test_dir,
|
58
|
+
|
59
|
+
target_size=(224,224),
|
60
|
+
|
61
|
+
batch_size=batch_size,
|
62
|
+
|
63
|
+
classes=classes,
|
64
|
+
|
65
|
+
class_mode='categorical',
|
66
|
+
|
67
|
+
shuffle=True
|
68
|
+
|
69
|
+
)
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
#evaluate model
|
74
|
+
|
75
|
+
score=model.evaluate_generator(test_generator)
|
76
|
+
|
77
|
+
print('\n test loss:',score[0])
|
78
|
+
|
79
|
+
print('\n test_acc:',score[1])
|
80
|
+
|
81
|
+
```
|