Random_clip_valid.py 文件源码

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

项目:C3D-tensorflow 作者: hx173149 项目源码 文件源码
def __init__(self,
            num_class = 101,
            keep_prob = 0.6,
            batch_size = 3,
            epoch=40,
            lr = 1e-4):
        self.IMG_WIDTH = 171
        self.IMG_HEIGHT = 128

        self.CROP_WIDTH = 112
        self.CROP_HEIGHT = 112
        self.graph = tf.Graph()
        self.num_class = num_class
        self.epoch = epoch
        self.CLIP_LENGTH = 16
        self.keep_prob = keep_prob
        self.batch_size = batch_size
        decay_epoch=10   #?5?epoch???????
        # train clip: 9537*5 CLIP=5
        # test  clip: 3783*5 CLIP=5
        # train clip: 9537*3 CLIP=3
        # test  clip: 3783*3 CLIP=3
        self.n_step_epoch=int( 9537/batch_size)
        with self.graph.as_default():
            self.inputs = tf.placeholder(tf.float32, [None, self.CLIP_LENGTH, self.CROP_HEIGHT, self.CROP_WIDTH, 3])
            self.labels = tf.placeholder(tf.int64, [batch_size,])

            self.initializer = layers.xavier_initializer()
            self.global_step = tf.Variable(0, trainable = False, name = "global_step")
            self.lr = tf.train.exponential_decay(lr, self.global_step, int(decay_epoch*self.n_step_epoch), 1e-1, True)
            tf.add_to_collection(tf.GraphKeys.GLOBAL_STEP, self.global_step)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号