          logger.debug("Refreshing")
          if not self.session.initialized:
              logger.warning("Session data is not initialized. Not refreshing")
              return None
          self.iterations = 0
          self.stats = self._get_raw()
          self.get_calculations()
          self.remove_raw()
          logger.debug("Refreshed")
          return self
  
      def _get_raw(self):
          """ Obtain the raw loss values.
 
</s> remove         if not self.session.initialized:
 </s> add         if not Session.is_loaded: </s> remove     def _get_raw(self):
        """ Obtain the raw loss values.
 </s> add     def set_smooth_amount(self, amount):
        """ Set the amount of smoothing to apply to smoothed graph. </s> remove                 if self.iterations == 0:
                    raw = {lossname: list() for lossname in raw}
 </s> add                 if self._iterations == 0:
                    self.stats = {lossname: np.array(list(), dtype=loss.dtype)
                                  for lossname, loss in self.stats.items()} </s> remove             self.iterations = 0 if not iterations else min(iterations)
 </s> add 
        self._iterations = 0
        self._get_raw()
        self._get_calculations()
        self._remove_raw()
          logger.debug("Refreshing")
          if not self.session.initialized:
              logger.warning("Session data is not initialized. Not refreshing")
              return None
        self._iterations = 0
        self._get_raw()
        self._get_calculations()
        self._remove_raw()
        self._iterations = 0
        self._get_raw()
        self._get_calculations()
        self._remove_raw()
        self._iterations = 0
        self._get_raw()
        self._get_calculations()
        self._remove_raw()
        self._iterations = 0
        self._get_raw()
        self._get_calculations()
        self._remove_raw()
          logger.debug("Refreshed")
          return self
  
      def _get_raw(self):
          """ Obtain the raw loss values.
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