builder.py 文件源码

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

项目:Super_TF 作者: Dhruv-Mohan 项目源码 文件源码
def construct_renorm_dict(self, Rmax, Dmax, R_Iter, D_Iter):
        rmax = tf.Variable(1.0, trainable=False, name='Rmax', dtype=tf.float32)
        rmin = tf.Variable(0.99, trainable=False, name='Rmin', dtype=tf.float32)
        dmax = tf.Variable(0.0, trainable=False, name='Dmax', dtype=tf.float32)
        update_rmax = tf.cond(self.global_step<R_Iter, self.assign_add(rmax, 1, Rmax, R_Iter), self.make_noop).op
        update_dmax = tf.cond(self.global_step<D_Iter, self.assign_add(dmax, 0, Dmax, D_Iter), self.make_noop).op
        update_rmin = tf.cond(self.global_step<R_Iter, self.assign_inv(rmin, rmax), self.make_noop).op

        tf.summary.scalar('rmax', rmax)
        tf.summary.scalar('rmin', rmin)
        tf.summary.scalar('dmax', dmax)

        tf.add_to_collection(tf.GraphKeys.UPDATE_OPS, update_rmax)
        tf.add_to_collection(tf.GraphKeys.UPDATE_OPS, update_dmax)
        tf.add_to_collection(tf.GraphKeys.UPDATE_OPS, update_rmin)

        self.renorm_dict = {'rmax':rmax, 'rmin':0.0, 'dmax':dmax}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号