chaienrを使ってディープラーニングをおこなっているのですが、ランダムに生成した入力画像を先にテストのための関数に代入した場合、トレーニングの結果よりテストの結果が良くなってしまいます。
count = 0 while True: count = count + 1 if count > 500: #train date x_tr = [] for j in range(0, int(img.shape[0])): for k in range(0, int(img.shape[1])): if img[j][k] >1001: img.flags.writeable = True img[j][k]=1000 img.flags.writeable = True x_tr.append(np.float32(float(img[j][k])/1000)) else: img.flags.writeable = True x_tr.append(np.float32(float(img[j][k])/1000)) x_train.append(np.reshape(x_tr, (1, 125, 180))) y_train.append(np.array((hand_wrist, fing_first0, fing_second0, fing_third0, fing_fourth0))) else: #test date x_te = [] for j in range(0, int(img.shape[0])): for k in range(0, int(img.shape[1])): if img[j][k] >1001: img.flags.writeable = True img[j][k]=1000 img.flags.writeable = True x_te.append(np.float32(float(img[j][k])/1000))#sys.maxint *5500max to katei look plot else: img.flags.writeable = True x_te.append(np.float32(float(img[j][k])/1000))#sys.maxint *5500max to katei look plot x_test.append(np.reshape(x_te, (1, 125, 180))) y_test.append(np.array((hand_wrist, fing_first0, fing_second0, fing_third0, fing_fourth0))) if count == 1000: break
また、先にトレーニングの関数に画像を入力するとトレーニングの結果がよくなり、テストが悪くなります。
いったい何故なのでしょうか・・・
お力添えよろしくお願いします。
###使用環境
visual studio2015
chainer 1.8.0
先にテスト関数に 先にトレーニング関数に
の意味が分かりません
トレーニングデータ入力→トレーニング→トレーニングされたモデル
テストデータ入力→トレーニングされたモデル→予測値
が通常ですがこれとは別のことを試されているということでしょうか
あなたの回答
tips
プレビュー