2017-06-06 6 views
-1

私はモデルを訓練しようとしています。私は非常に多くのパラメータを試して、サンプル数も増やしました。しかし、私のモデルで何がうまくいかないのか予測できず、精度を上げるために何をすべきですか?ここに私のコードの詳細があります。私は1つのクラスで5万のサンプルを収集しており、トレーニングのために95%のデータを使用しています。機械学習でこの結果をどのように解釈するのですか?モデルで何がうまくいかないのですか?

def conv2d(input, filter): 
    return tf.nn.conv2d(input, filter, strides=[1, 2, 2, 1], padding='SAME') 
def max_pool(conv_out1): 
    return tf.nn.max_pool(conv_out1, ksize=[1,2,2,1], strides= 1,2,2,1], padding='SAME') 
input = tf.reshape(x, [-1, 16, 16,1]) 
filter = weight_variable([3, 3, 1,5]) 
conv_out1 = tf.nn.relu(conv2d(input,filter)) 
pooling_out1 = max_pool(conv_out1) 
print pooling_out1.get_shape() 
pool_list = pooling_out1.get_shape().as_list() 
z = pool_list[1]*pool_list[2]*pool_list[3] 
W_fc_input = tf.reshape(pooling_out2,[-1,z]) 
W_fc = weight_variable([z, 25]) 
entropy = tf.nn.softmax_cross_entropy_with_logits(logits=logits,labels=y_) 
loss = tf.reduce_mean(entropy) 
run_optimizer = tf.train.AdamOptimizer(1e-4).minimize(loss) 
for i in range(total_train_step): 
    batch = Input.train.next_batch(batch_size) 
    run_optimizer.run(feed_dict={x: batch[0], y_: batch[1], keep_prob: 0.5}) 
    if i % FLAGS.step_interval == 0: 
     train_accuracy = accuracy.eval(feed_dict={x: batch[0], y_: batch[1], keep_prob: 1.0}) 
     test_accuracy = accuracy.eval(feed_dict={x: Input_test.Samples, y_: InputData.test.labels, keep_prob: 1.0}) 

accuracy here

+1

あなたのデータがあまりにも騒々しいことがあります、あなたのモデルがあまりにも単純であるかもしれない、あなたはデータを読み込んで準備する間違いがあるかもしれません。詳細をご記入ください。 – sibnick

+0

コードに関する詳細を追加しました –

+0

1つの畳み込みレイヤーを追加しようとしましたが、IDが効率を改善していません –

答えて

0

私はあなたがreduce_meanから異なる何かに損失関数を変更する必要がありますと仮定します。損害額はトレーニング中に変更されません。最初の試みとして、reduce_sumを試すことができます。

関連する問題