2017-01-14 13 views
1

最近、ニューラルネットワークとそれらの用途をアプリケーションで使用しています。ちょうど最近、私は0-9(MNIST)から手書き数字を分類する方法を学ぶニューラルネットワークを説明するチュートリアルに出くわしました。私はとのトラブルを抱えているチュートリアルからのコードの一部は、私は何が起こっているかの基本的な知識を持っている(https://pythonprogramming.net/tensorflow-neural-network-session-machine-learning-tutorial/基本ニューラルネットワークでの整流線形関数の使用

def neural_network_model(data): 
    hidden_1_layer = {'weights':tf.Variable(tf.random_normal([784, nodes_hl1])), 
       'biases':tf.Variable(tf.random_normal([nodes_hl1]))} 

    hidden_2_layer = {'weights':tf.Variable(tf.random_normal([nodes_hl1, nodes_hl2])), 
       'biases':tf.Variable(tf.random_normal([nodes_hl2]))} 

    hidden_3_layer = {'weights':tf.Variable(tf.random_normal([nodes_hl2, nodes_hl3])), 
       'biases':tf.Variable(tf.random_normal([nodes_hl3]))} 

    output_layer = {'weights':tf.Variable(tf.random_normal([nodes_hl3, n_classes])), 
       'biases':tf.Variable(tf.random_normal([n_classes])),} 


    l1 = tf.add(tf.matmul(data,hidden_1_layer['weights']), hidden_1_layer['biases']) 
    l1 = tf.nn.relu(l1) 

    l2 = tf.add(tf.matmul(l1,hidden_2_layer['weights']), hidden_2_layer['biases']) 
    l2 = tf.nn.relu(l2) 

    l3 = tf.add(tf.matmul(l2,hidden_3_layer['weights']), hidden_3_layer['biases']) 
    l3 = tf.nn.relu(l3) 

    output = tf.matmul(l3,output_layer['weights']) + output_layer['biases'] 

    return output 

を下回っています。 3つの隠れ層は、それぞれ、バイアスおよび重みによって接続されたノードの集合である。最終的な出力層は、ニューラルネットワークの結果である。 tf.nn.relu()を含むコード行を除いて、ここではすべてを理解しています。 TensorFlowのドキュメンテーションを見ると、その関数は整流されたフィーチャの線形(https://www.tensorflow.org/api_docs/python/nn/activation_functions_#relu)を計算することに言及しています。私は、この機能が何を実行しているのか、それがニューラルネットワークにどのような意味を持っているのか、むしろ混乱しています。

答えて

1

シグモイドのようないくつかの他の機能は

  • をsatturateする傾向があるreluのいくつかの利点(整流線形単位されている)

    • 少ない計算コストが高い(したがって、より良い性能)
    • 彼らはその誘導体を持っています

    (訓練プロセスが誘導体に依存している覚えている)カルクに簡単です。このhttps://www.quora.com/What-are-the-benefits-of-using-rectified-linear-units-vs-the-typical-sigmoid-activation-function

    をご確認ください
  • 関連する問題