import tensorflow as tf

    self.fetch_datasets()
    if FLAGS.model == AUTOENCODER:
      self.build_ae_model()
    elif FLAGS.model == PREDICTIVE:
      self.build_predictive_model()
    else:
      self.build_denoising_model()
    self._init_optimizer()

    with tf.Session() as sess:
      sess.run(tf.global_variables_initializer())
      self._on_training_start(sess)

      try:
        for current_epoch in range(FLAGS.max_epochs):
          start = time.time()
          full_set_blur = len(self.train_set) < 50000
          ds = self._get_blurred_dataset() if full_set_blur else self.train_set
          if FLAGS.model == AUTOENCODER:

