class_docstr: This class initialises an application by building a TF graph,
  and maintaining a session. It controls the
  starting/stopping of an application. Applications should be
  implemented by inheriting ``niftynet.application.base_application``
  to be compatible with this driver.
class_docstr_tok: ["This","class","initialises","an","application","by","building","a","TF","graph",",","and","maintaining","a","session",".","It","controls","the","starting\/stopping","of","an","application",".","Applications","should","be","implemented","by","inheriting","``","niftynet.application.base_application","``","to","be","compatible","with","this","driver","."]
code: def __init__(self):
      self.app = None
  
      self.is_training_action = True
      self.num_threads = 0
      self.num_gpus = 0
      self.model_dir = None
  
      self.max_checkpoints = 2
      self.save_every_n = 0
      self.tensorboard_every_n = -1
      self.vars_to_restore = ""
  
      self.initial_iter = 0
      self.final_iter = 0
      self.validation_every_n = -1
      self.validation_max_iter = 1
  
      self.data_partitioner = ImageSetsPartitioner()
  
      self._event_handlers = None
      self._generator = None
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import time
  import tensorflow
  from niftynet.engine.application_factory import ApplicationFactory, EventHandlerFactory, IteratorFactory
  from niftynet.engine.application_iteration import IterationMessage
  from niftynet.engine.application_variables import GradientsCollector, OutputsCollector
  from niftynet.engine.signal import TRAIN, ITER_STARTED, ITER_FINISHED, GRAPH_CREATED, SESS_FINISHED, SESS_STARTED
  from niftynet.io.image_sets_partitioner import ImageSetsPartitioner
  from niftynet.io.misc_io import infer_latest_model_file
  from niftynet.utilities.user_parameters_default import DEFAULT_EVENT_HANDLERS, DEFAULT_ITERATION_GENERATOR
  from niftynet.utilities.util_common import set_cuda_device, tf_config, device_string
  from niftynet.utilities.util_common import traverse_nested
label_desc: Use image node_id 1 to create a new ApplicationDriver object from inherited base classes: object with example: obj = ApplicationDriver()