  
          When the analysis folder has been populated - Updates the stats from that folder.
          """
          self.vars["refresh_graph"].trace("w", self._update_current_session)
          self.vars["is_training"].trace("w", self._remove_current_session)
          self.vars["analysis_folder"].trace("w", self._populate_from_folder)
  
      def _update_current_session(self, *args):  # pylint:disable=unused-argument
          """ Update the currently training session data on a graph update callback. """
          if not self.vars["refresh_graph"].get():
 
</s> remove         When training is commenced - Removes the currently displayed session.

 </s> add  </s> remove     def _remove_current_session(self, *args):  # pylint:disable=unused-argument
        """ Remove the current session data on a is_training=False callback """
        if self.vars["is_training"].get():
            return
        logger.debug("Remove current training Analysis callback received")
        self._clear_session()

 </s> add  </s> remove     """ Parse and return data from TensorBoard logs """
 </s> add     """ Parse data from TensorBoard logs.

    Process the input logs folder and stores the individual filenames per session.

    Caches timestamp and loss data on request and returns this data from the cache.

    Parameters
    ----------
    logs_folder: str
        The folder that contains the Tensorboard log files
    """
  
          When the analysis folder has been populated - Updates the stats from that folder.
          """
          self.vars["refresh_graph"].trace("w", self._update_current_session)

          self.vars["analysis_folder"].trace("w", self._populate_from_folder)
  
      def _update_current_session(self, *args):  # pylint:disable=unused-argument
          """ Update the currently training session data on a graph update callback. """
          if not self.vars["refresh_graph"].get():
keep keep keep keep replace keep keep keep keep keep
 GUI - Stats optimization (#1067)

* Faster stat loading + caching

* Compress data in cache

* Optimize some calculations

* Vectorize smoothing

* stats.Calculations optimized

* Load latest training data from live iterator

* Add options to training graph 
lib/gui/display_analysis.py