質問編集履歴
2
プログラムの修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -27,26 +27,6 @@
|
|
27
27
|
|
28
28
|
|
29
29
|
```python
|
30
|
-
|
31
|
-
import numpy as np
|
32
|
-
|
33
|
-
import pandas as pd
|
34
|
-
|
35
|
-
from pandas import DataFrame
|
36
|
-
|
37
|
-
from sklearn.model_selection import train_test_split
|
38
|
-
|
39
|
-
from keras.layers.core import Dense, Activation
|
40
|
-
|
41
|
-
from keras.models import Sequential, load_model
|
42
|
-
|
43
|
-
from keras.optimizers import SGD
|
44
|
-
|
45
|
-
import matplotlib.pyplot as plt
|
46
|
-
|
47
|
-
import csv
|
48
|
-
|
49
|
-
|
50
30
|
|
51
31
|
data = pd.read_csv('SPSS.csv', sep=",", header=0)
|
52
32
|
|
@@ -180,69 +160,13 @@
|
|
180
160
|
|
181
161
|
|
182
162
|
|
183
|
-
graph_name = 'epochs:' + 'epochs'
|
184
|
-
|
185
|
-
plot_everytime = True
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
def plot_show_close():
|
190
|
-
|
191
|
-
global plot_everytime
|
192
|
-
|
193
|
-
if plot_everytime:
|
194
|
-
|
195
|
-
plt.show()
|
196
|
-
|
197
|
-
plt.close()
|
198
|
-
|
199
163
|
|
200
164
|
|
201
165
|
def plot_acc():
|
202
166
|
|
203
|
-
plt.rc('font', family='serif')
|
204
|
-
|
205
|
-
plt.plot(hist_acc_t)
|
206
|
-
|
207
|
-
plt.plot(hist_acc_v)
|
208
|
-
|
209
|
-
plt.title('Accuracy ({})'.format(graph_name))
|
210
|
-
|
211
|
-
plt.xlabel('epoch')
|
212
|
-
|
213
|
-
plt.ylabel('accuracy')
|
214
|
-
|
215
|
-
plt.legend(['acc', 'val_acc'], loc='lower right')
|
216
|
-
|
217
|
-
plt.savefig('G_Acc' + '.png', dpi=300)
|
218
|
-
|
219
|
-
plt.savefig('G_Acc' + '.eps')
|
220
|
-
|
221
|
-
plot_show_close()
|
222
|
-
|
223
167
|
|
224
168
|
|
225
169
|
def plot_loss():
|
226
|
-
|
227
|
-
plt.rc('font', family='serif')
|
228
|
-
|
229
|
-
plt.plot(hist_loss_t)
|
230
|
-
|
231
|
-
plt.plot(hist_loss_v)
|
232
|
-
|
233
|
-
plt.title('Loss ({})'.format(graph_name))
|
234
|
-
|
235
|
-
plt.xlabel('epoch')
|
236
|
-
|
237
|
-
plt.ylabel('loss')
|
238
|
-
|
239
|
-
plt.legend(['loss', 'val_loss'], loc='upper right')
|
240
|
-
|
241
|
-
plt.savefig('G_Loss' + '.png', dpi=300)
|
242
|
-
|
243
|
-
plt.savefig('G_Loss' + '.eps')
|
244
|
-
|
245
|
-
plot_show_close()
|
246
170
|
|
247
171
|
|
248
172
|
|
1
プログラムの修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -162,20 +162,6 @@
|
|
162
162
|
|
163
163
|
loss = hist.history['loss']
|
164
164
|
|
165
|
-
'''
|
166
|
-
|
167
|
-
plt.rc('font', family='serif')
|
168
|
-
|
169
|
-
fig = plt.figure()
|
170
|
-
|
171
|
-
plt.plot(range(epochs), acc, label='acc', color='black')
|
172
|
-
|
173
|
-
plt.xlabel('epochs')
|
174
|
-
|
175
|
-
plt.show()
|
176
|
-
|
177
|
-
'''
|
178
|
-
|
179
165
|
|
180
166
|
|
181
167
|
index = ['acc_t', 'acc_v', 'loss_t', 'loss_v']
|