Dense_Transformer_Networks_3D.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:3D_Dense_Transformer_Networks 作者: JohnYC1995 项目源码 文件源码
def _local_Networks(self,input_dim,x):
        with tf.variable_scope('_local_Networks'):
            x = tf.reshape(x,[-1,self.height*self.width*self.depth*self.num_channels])
            W_fc_loc1 = weight_variable([self.height*self.width*self.depth*self.num_channels, 20])
            b_fc_loc1 = bias_variable([20])
            W_fc_loc2 = weight_variable([20, self.X_controlP_number*self.Y_controlP_number*self.Z_controlP_number*3])
            initial = self.initial.astype('float32')
            initial = initial.flatten()
            b_fc_loc2 = tf.Variable(initial_value=initial, name='b_fc_loc2')
            h_fc_loc1 = tf.nn.tanh(tf.matmul(x, W_fc_loc1) + b_fc_loc1)
            h_fc_loc2 = tf.nn.tanh(tf.matmul(h_fc_loc1, W_fc_loc2) + b_fc_loc2)
            #temp use
            if Debug == True:
                x = np.linspace(-1.0,1.0,self.X_controlP_number)
                y = np.linspace(-1.0,1.0,self.Y_controlP_number)
                z = np.linspace(-1.0,1.0,self.Z_controlP_number)
                x_s = tf.tile(x,[self.Y_controlP_number*self.Z_controlP_number],'float64')
                y_s = tf.tile(self._repeat(y,self.X_controlP_number,'float64'),[self.Z_controlP_number])
                z_s = self._repeat(z,self.X_controlP_number*self.Y_controlP_number,'float64')
                h_fc_loc2 = tf.concat([x_s,y_s,z_s],0)
                h_fc_loc2 = tf.tile(h_fc_loc2,[self.num_batch])
                h_fc_loc2 = tf.reshape(h_fc_loc2,[self.num_batch,-1])
            #2*(4*4*4)*3->(2,192)
            return h_fc_loc2
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号