                    "iterations": iterations}
          logger.debug(totals)
          return totals
  
      @staticmethod
      def format_stats(compiled_stats):
          """ Format for display """
          logger.debug("Formatting stats")
          for summary in compiled_stats:
              hrs, mins, secs = convert_time(summary["elapsed"])
              summary["start"] = time.strftime("%x %X", time.localtime(summary["start"]))
              summary["end"] = time.strftime("%x %X", time.localtime(summary["end"]))
 
</s> remove             hrs, mins, secs = convert_time(summary["elapsed"])
            summary["start"] = time.strftime("%x %X", time.localtime(summary["start"]))
            summary["end"] = time.strftime("%x %X", time.localtime(summary["end"]))
            summary["elapsed"] = "{}:{}:{}".format(hrs, mins, secs)
            summary["rate"] = "{0:.1f}".format(summary["rate"])
        return compiled_stats
 </s> add             hrs, mins, secs = self._convert_time(summary["elapsed"])
            stats = dict()
            for key in summary:
                if key not in ("start", "end", "elapsed", "rate"):
                    stats[key] = summary[key]
                    continue
                stats["start"] = time.strftime("%x %X", time.localtime(summary["start"]))
                stats["end"] = time.strftime("%x %X", time.localtime(summary["end"]))
                stats["elapsed"] = "{}:{}:{}".format(hrs, mins, secs)
                stats["rate"] = "{0:.1f}".format(summary["rate"])
            retval.append(stats)
        return retval

    @classmethod
    def _convert_time(cls, timestamp):
        """ Convert time stamp to total hours, minutes and seconds.

        Parameters
        ----------
        timestamp: float
            The Unix timestamp to be converted

        Returns
        -------
        tuple
            (`hours`, `minutes`, `seconds`) as ints
        """
        hrs = int(timestamp // 3600)
        if hrs < 10:
            hrs = "{0:02d}".format(hrs)
        mins = "{0:02d}".format((int(timestamp % 3600) // 60))
        secs = "{0:02d}".format((int(timestamp % 3600) % 60))
        return hrs, mins, secs </s> remove         total_summaries = len(sessions_stats)
        for idx, summary in enumerate(sessions_stats):
 </s> add         total_summaries = len(self._per_session_stats)
        for idx, summary in enumerate(self._per_session_stats): </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
    """ </s> remove     @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()])
 </s> add         Format the stats for display
    def _format_stats(self, compiled_stats):
        """ Format for the incoming list of statistics for display.

        Parameters
        ----------
        compiled_stats: list
            List of summary statistics dictionaries to be formatted for display

        Returns
        -------
        list
            The original statistics formatted for display
        """
                    "iterations": iterations}
          logger.debug(totals)
          return totals
  
    def _format_stats(self, compiled_stats):
        """ Format for the incoming list of statistics for display.

        Parameters
        ----------
        compiled_stats: list
            List of summary statistics dictionaries to be formatted for display

        Returns
        -------
        list
            The original statistics formatted for display
        """
    def _format_stats(self, compiled_stats):
        """ Format for the incoming list of statistics for display.

        Parameters
        ----------
        compiled_stats: list
            List of summary statistics dictionaries to be formatted for display

        Returns
        -------
        list
            The original statistics formatted for display
        """
    def _format_stats(self, compiled_stats):
        """ Format for the incoming list of statistics for display.

        Parameters
        ----------
        compiled_stats: list
            List of summary statistics dictionaries to be formatted for display

        Returns
        -------
        list
            The original statistics formatted for display
        """
          logger.debug("Formatting stats")
          for summary in compiled_stats:
              hrs, mins, secs = convert_time(summary["elapsed"])
              summary["start"] = time.strftime("%x %X", time.localtime(summary["start"]))
              summary["end"] = time.strftime("%x %X", time.localtime(summary["end"]))
keep keep keep keep 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