'Basic setup.
Args:
config: Object containing configuration parameters.
mode: "train", "eval" or "inference".
train_inception: Whether the inception submodel variables are trainable.'

def __init__(self, config, mode, train_inception=False):

    assert (mode in ['train', 'eval', 'inference'])
    self.config = config
    self.mode = mode
    self.train_inception = train_inception
    self.reader = tf.TFRecordReader()
    self.initializer = tf.random_uniform_initializer(minval=(- self.config.initializer_scale), maxval=self.config.initializer_scale)
    self.images = None
    self.input_seqs = None
    self.target_seqs = None
    self.input_mask = None
    self.image_embeddings = None
    self.seq_embeddings = None
    self.total_loss = None
    self.target_cross_entropy_losses = None
    self.target_cross_entropy_loss_weights = None
    self.inception_variables = []
    self.init_fn = None
    self.global_step = None
