各位先進目前在研究上遇到問題個問題想請各位先進幫我打解答 感謝!
目前想做一個雙輸入的卷積神經網路,各別輸入不同的影像卷積然後共用全連接層。
.
.
.
with tf.variable_scope('s_pooling3_lrn') as scope:
pool3 = max_pool_2x2(s_conv3, 's_pooling3') # 得到32*32*32
s_norm3 = tf.nn.lrn(pool3, depth_radius=4, bias=1.0, alpha=0.001 / 9.0, beta=0.75, name='s_norm3')
.
.
.
with tf.variable_scope('T_pooling3_lrn') as scope:
pool3 = max_pool_2x2(T_conv3, 'T_pooling3') # 得到32*32*32
T_norm3 = tf.nn.lrn(pool3, depth_radius=4, bias=1.0, alpha=0.001 / 9.0, beta=0.75, name='T_norm3')
local4 = s_norm3 + T_norm3
with tf.variable_scope('local4') as scope:
reshape = tf.reshape(local4, shape=[batch_size, -1])
dim = reshape.get_shape()[1].value
w_fc1 = tf.Variable(weight_variable([dim, 128], 0.005), name='weights', dtype=tf.float32)
b_fc1 = tf.Variable(bias_variable([128]), name='biases', dtype=tf.float32)
h_fc1 = tf.nn.relu(tf.matmul(reshape, w_fc1) + b_fc1, name=scope.name)
程式裡 **local4 = s_norm3 + T_norm3 **
這段是目前將兩邊卷積後的結果做結合讓兩邊filter合併再到全連接層展開
但我現在想要做是否可以讓兩邊輸入做到pooling後,一邊先進去做全連接再讓另一邊的結果作全連接。不要兩邊合併再去全連接! 達到可以共用全連接層的效果。
請問我該加上判斷還是該怎樣改才能達到我想要的結果 還請各位先進幫忙解答