              data = Calculations(session=get_config().session,
                                  display="loss",
                                  loss_keys=display_keys,
                                  selections=["raw", "smoothed"],
                                  smooth_amount=get_config().tk_vars["smoothgraph"].get())
              self.add_child(tabname, data)
  
      def smooth_amount_callback(self, *args):
          """ Update each graph's smooth amount on variable change """
          smooth_amount = get_config().tk_vars["smoothgraph"].get()
 
</s> remove     def smooth_amount_callback(self, *args):
 </s> add     def _smooth_amount_callback(self, *args): </s> remove         smooth_amount = get_config().tk_vars["smoothgraph"].get()
 </s> add         try:
            smooth_amount = self.vars["smoothgraph"].get()
        except tk.TclError:
            # Don't update when there is no value in the variable
            return </s> remove             data = Calculations(session=get_config().session,
 </s> add             data = Calculations(session_id=Session.session_ids[-1], </s> remove             graph.calcs.args["smooth_amount"] = smooth_amount
 </s> add             graph.calcs.set_smooth_amount(smooth_amount)

    def _iteration_limit_callback(self, *args):
        """ Limit the amount of data displayed in the live graph on a iteration slider
        variable change. """
        try:
            limit = self.vars["display_iterations"].get()
        except tk.TclError:
            # Don't update when there is no value in the variable
            return
        logger.debug("Updating graph iteration limit: (new_value: %s, args: %s)",
                     limit, args)
        for graph in self.subnotebook.children.values():
            graph.calcs.set_iterations_limit(limit)

    def _display_data_callback(self, line, variable):
        """ Update the displayed graph lines based on option check button selection.

        Parameters
        ----------
        line: str
            The line to hide or display
        variable: :class:`tkinter.BooleanVar`
            The tkinter variable containing the ``True`` or ``False`` data for this display item
        """
        var = variable.get()
        logger.debug("Updating display %s to %s", line, var)
        for graph in self.subnotebook.children.values():
            graph.calcs.update_selections(line, var) </s> remove         self.vars["is_training"].trace("w", self._remove_current_session)
 </s> add 
                                smooth_amount=self.vars["smoothgraph"].get())
              data = Calculations(session=get_config().session,
                                  display="loss",
                                  loss_keys=display_keys,
                                  selections=["raw", "smoothed"],
                                smooth_amount=self.vars["smoothgraph"].get())
              self.add_child(tabname, data)
  
      def smooth_amount_callback(self, *args):
          """ Update each graph's smooth amount on variable change """
          smooth_amount = get_config().tk_vars["smoothgraph"].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_command.py