(self, tokens, adjvec, im_shape)
CIFARModel init
CIFARModel init
CIFARModel init
def __init__(self, tokens, adjvec, im_shape):
        """
            CIFARModel init
        """
        chunk_size = FLAGS.chunk_size
        self.batch_size = FLAGS.batch_size
        self.tokens = tokens
        self.adjvec = adjvec
        self.im_shape = im_shape
        max_step = chunk_size * 9 * FLAGS.T_0 // FLAGS.batch_size
        test_batch = chunk_size // FLAGS.batch_size

        def cosine_decay():
            """
                Applies cosine decay to the learning rate.
            """
            global_step = _decay_step_counter()
            frac = (1 + ops.cos(global_step / max_step * math.pi)) / 2
            return FLAGS.lr_min + (FLAGS.lr_max - FLAGS.lr_min) * frac

        self.lr_strategy = cosine_decay
def __init__ ( self , tokens , adjvec , im_shape ) : chunk_size = FLAGS . chunk_size self . batch_size = FLAGS . batch_size self . tokens = tokens self . adjvec = adjvec self . im_shape = im_shape max_step = chunk_size * 9 * FLAGS . T_0 // FLAGS . batch_size test_batch = chunk_size // FLAGS . batch_size def cosine_decay ( ) : """
                Applies cosine decay to the learning rate.
            """ global_step = _decay_step_counter ( ) frac = ( 1 + ops . cos ( global_step / max_step * math . pi ) ) / 2 return FLAGS . lr_min + ( FLAGS . lr_max - FLAGS . lr_min ) * frac self . lr_strategy = cosine_decay