      """ The Loaded or current training session """
      def __init__(self, model_dir=None, model_name=None):
          logger.debug("Initializing %s: (model_dir: %s, model_name: %s)",
                       self.__class__.__name__, model_dir, model_name)
          self.serializer = JSONSerializer
          self.state = None
          self.modeldir = model_dir  # Set and reset by wrapper for training sessions
          self.modelname = model_name  # Set and reset by wrapper for training sessions
          self.tb_logs = None
          self.initialized = False
 
</s> remove         self.serializer = Serializer.get_serializer("json")
        filename = "{}_state.{}".format(model_name, self.serializer.ext)
 </s> add         self.serializer = get_serializer("json")
        filename = "{}_state.{}".format(model_name, self.serializer.file_extension) </s> remove         self.serializer = JSONSerializer
 </s> add         self.serializer = get_serializer("json") </s> remove             serializer_ext = os.path.splitext(
                self.args.log_file_path)[-1]
            self.serializer = Serializer.get_serializer_from_ext(
                serializer_ext)
 </s> add             self.serializer = get_serializer_from_filename(self.args.log_file_path) </s> remove         try:
            with open(state_file, "rb") as inp:
                state = self.serializer.unmarshal(inp.read().decode("utf-8"))
                self.state = state
                logger.debug("Loaded state: %s", state)
        except IOError as err:
            logger.warning("Unable to load state file. Graphing disabled: %s", str(err))
 </s> add         self.state = self.serializer.load(state_file)
        logger.debug("Loaded state: %s", self.state) </s> remove         self.serializer = Serializer.get_serializer("json")
 </s> add         self.serializer = get_serializer("json")
        self.serializer = get_serializer("json")
      """ The Loaded or current training session """
      def __init__(self, model_dir=None, model_name=None):
          logger.debug("Initializing %s: (model_dir: %s, model_name: %s)",
                       self.__class__.__name__, model_dir, model_name)
        self.serializer = get_serializer("json")
          self.state = None
          self.modeldir = model_dir  # Set and reset by wrapper for training sessions
          self.modelname = model_name  # Set and reset by wrapper for training sessions
          self.tb_logs = None
          self.initialized = False
keep keep keep keep replace keep keep keep keep keep
 Standardize serialization (#903)

* Standardize serialization

- Linting
- Standardize serializer use throughout code
- Extend serializer to load and save files
- Always load and save in utf-8
- Create documentation 
lib/gui/stats.py