      def session(self):
          """ Return current session dictionary """
          return self.state["sessions"].get(str(self.session_id), dict())
  
      @property
      def session_ids(self):
          """ Return sorted list of all existing session ids in the state file """
          return sorted([int(key) for key in self.state["sessions"].keys()])
  
      @property
      def timestamps(self):
          """ Return timestamps from logs for current session """
          ts_dict = self.tb_logs.get_timestamps(session=self.session_id)
 
</s> remove     @property
    def session(self):
        """ Return current session dictionary """
        return self.state["sessions"].get(str(self.session_id), dict())
 </s> add     def get_summary_stats(self):
        """ Compile the individual session statistics and calculate the total. </s> remove     @property
    def timestamps(self):
        """ Return timestamps from logs for current session """
        ts_dict = self.tb_logs.get_timestamps(session=self.session_id)
        return ts_dict[self.session_id]
 </s> add         Returns
        -------
        list
            A list of summary statistics dictionaries containing the Session ID, start time, end
            time, elapsed time, rate, batch size and number of iterations for each session id
            within the loaded data as well as the totals.
        """
        logger.debug("Compiling sessions summary data")
        self._get_time_stats()
        self._get_per_session_stats()
        if not self._per_session_stats:
            return self._per_session_stats

        total_stats = self._total_stats()
        retval = self._per_session_stats + [total_stats]
        retval = self._format_stats(retval)
        logger.debug("Final stats: %s", retval)
        return retval </s> remove     @property
    def total_batchsize(self):
        """ Return all session batch sizes """
        return {int(sess_id): sess["batchsize"]
                for sess_id, sess in self.state["sessions"].items()}
 </s> add     def _get_time_stats(self):
        """ Populates the attribute :attr:`_time_stats` with the start start time, end time and
        data points for each session id within the loaded session if it has not already been
        calculated. </s> remove     @property
    def lowest_loss(self):
        """ Return the lowest average loss per save iteration seen """
        return self.state["lowest_avg_loss"]
 </s> add         self._time_stats = None
        self._per_session_stats = None
        logger.debug("Initialized %s", self.__class__.__name__) </s> remove     @property
    def total_timestamps(self):
        """ Return timestamps from logs separated per session for all sessions """
        return self.tb_logs.get_timestamps()

    def initialize_session(self, is_training=False, session_id=None):
        """ Initialize the training session """
        logger.debug("Initializing session: (is_training: %s, session_id: %s)",
                     is_training, session_id)
        self.load_state_file()
        self.tb_logs = TensorBoardLogs(os.path.join(self.modeldir,
                                                    "{}_logs".format(self.modelname)))
        if is_training:
            self.session_id = max(int(key) for key in self.state["sessions"].keys())
        else:
            self.session_id = session_id
        self.initialized = True
        logger.debug("Initialized session. Session_ID: %s", self.session_id)
 </s> add             session_id = Session.session_ids[-1]
            latest = self._session.get_timestamps(session_id)
        Format the stats for display
      def session(self):
          """ Return current session dictionary """
          return self.state["sessions"].get(str(self.session_id), dict())
  
        Format the stats for display
        Format the stats for display
        Format the stats for display
        Format the stats for display
  
      @property
      def timestamps(self):
          """ Return timestamps from logs for current session """
          ts_dict = self.tb_logs.get_timestamps(session=self.session_id)
keep keep keep keep replace replace replace 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/stats.py