'Args:
d_period(int): period of each d_opt run
g_period(int): period of each g_opt run'

def __init__(self, config, d_period=1, g_period=1):

    self._d_period = int(d_period)
    self._g_period = int(g_period)
    assert (min(d_period, g_period) == 1)
    input = QueueInput(config.dataflow)
    model = config.model
    cbs = input.setup(model.get_inputs_desc())
    config.callbacks.extend(cbs)
    with TowerContext('', is_training=True):
        model.build_graph(input)
    opt = model.get_optimizer()
    with tf.name_scope('optimize'):
        self.d_min = opt.minimize(model.d_loss, var_list=model.d_vars, name='d_min')
        self.g_min = opt.minimize(model.g_loss, var_list=model.g_vars, name='g_min')
    super(SeparateGANTrainer, self).__init__(config)
