質問編集履歴
2
情報の修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,3 +1,35 @@
|
|
1
1
|
CNNでディープラーニングをしています。
|
2
2
|
どんなにエポックを繰り返しても学習精度が0.5ほどになってしまいます。どう言う原因が考えられますか?
|
3
|
-
データ数は1万件もあり、過学習の可能性はないです。
|
3
|
+
データ数は1万件もあり、過学習の可能性はないです。
|
4
|
+
|
5
|
+
コードは以下のように書きました。
|
6
|
+
```ここに言語を入力
|
7
|
+
# coding: utf-8
|
8
|
+
import tensorflow as tf
|
9
|
+
import tflearn
|
10
|
+
|
11
|
+
from tflearn.layers.core import input_data,dropout,fully_connected
|
12
|
+
from tflearn.layers.conv import conv_2d, max_pool_2d
|
13
|
+
from tflearn.layers.normalization import local_response_normalization
|
14
|
+
from tflearn.layers.estimator import regression
|
15
|
+
|
16
|
+
tf.reset_default_graph()
|
17
|
+
net = input_data(shape=[None, 4, 42])
|
18
|
+
net = conv_2d(net, 4, 16, activation='relu')
|
19
|
+
net = max_pool_2d(net, 1)
|
20
|
+
net = tflearn.activations.relu(net)
|
21
|
+
net = dropout(net, 0.5)
|
22
|
+
net = tflearn.fully_connected(net, 2, activation='softmax')
|
23
|
+
net = tflearn.regression(net, optimizer='adam', learning_rate=0.5, loss='categorical_crossentropy')
|
24
|
+
|
25
|
+
model = tflearn.DNN(net)
|
26
|
+
|
27
|
+
model.fit(np.array(trainDataSet), np.array(trainLabel), n_epoch=400, batch_size=32, validation_set=0.1, show_metric=True)
|
28
|
+
|
29
|
+
pred = np.array(model.predict(np.array(testDataSet)).argmax(axis=1))
|
30
|
+
|
31
|
+
label = np.array(testLabel).argmax(axis=0)
|
32
|
+
accuracy = np.mean(pred == label, axis=0)
|
33
|
+
|
34
|
+
print(accuracy)
|
35
|
+
```
|
1
情報の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,2 +1,3 @@
|
|
1
1
|
CNNでディープラーニングをしています。
|
2
|
-
どんなにエポックを繰り返しても学習精度が0.5ほどになってしまいます。どう言う原因が考えられますか?
|
2
|
+
どんなにエポックを繰り返しても学習精度が0.5ほどになってしまいます。どう言う原因が考えられますか?
|
3
|
+
データ数は1万件もあり、過学習の可能性はないです。
|