[TENSORFLOW] Sharing variables
tensorflow에서는 변수를 공유해서 쓸 수 있는 기능을 제공하고 있다. 가령 아래의 예제를 살펴보자. 아래의 예제는 relu function을 5개 생성하는 것이 목적인데, 생성 시에 threshold 파라미터를 함께 넘겨줘서 초기화를 진행하고 있다. def relu(X, threshold):with tf.name_scope("relu"):[...]return tf.maximum(z, threshold, name="max") threshold = tf.Variable(0.0, name="threshold")X = tf.placeholder(tf.float32, shape=(None, n_features), name="X") relus = [relu(X, threshold) for i in range..
2017.06.16