              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()
          logger.debug("Updating graph smooth_amount: (new_value: %s, args: %s)",
                       smooth_amount, args)
          for graph in self.subnotebook.children.values():
              graph.calcs.args["smooth_amount"] = smooth_amount
  
 
</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                                 smooth_amount=self.vars["smoothgraph"].get()) </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     """ Class to pull raw data for given session(s) and perform calculations """
    def __init__(self, session, display="loss", loss_keys=["loss"], selections=["raw"],
                 avg_samples=500, smooth_amount=0.90, flatten_outliers=False, is_totals=False):
        logger.debug("Initializing %s: (session: %s, display: %s, loss_keys: %s, selections: %s, "
                     "avg_samples: %s, smooth_amount: %s, flatten_outliers: %s, is_totals: %s",
                     self.__class__.__name__, session, display, loss_keys, selections, avg_samples,
                     smooth_amount, flatten_outliers, is_totals)
 </s> add     """ Class that performs calculations on the :class:`GlobalSession` raw data for the given
    session id.

    Parameters
    ----------
    session_id: int or ``None``
        The session id number for the selected session from the Analysis tab. Should be ``None``
        if all sessions are being calculated
    display: {"loss", "rate"}, optional
        Whether to display a graph for loss or training rate. Default: `"loss"`
    loss_keys: list, optional
        The list of loss keys to display on the graph. Default: `["loss"]`
    selections: list, optional
        The selected annotations to display. Default: `["raw"]`
    avg_samples: int, optional
        The number of samples to use for performing moving average calculation. Default: `500`.
    smooth_amount: float, optional
        The amount of smoothing to apply for performing smoothing calculation. Default: `0.9`.
    flatten_outliers: bool, optional
        ``True`` if values significantly away from the average should be excluded, otherwise
        ``False``. Default: ``False``
    """
    def __init__(self, session_id,
                 display="loss",
                 loss_keys="loss",
                 selections="raw",
                 avg_samples=500,
                 smooth_amount=0.90,
                 flatten_outliers=False):
        logger.debug("Initializing %s: (session_id: %s, display: %s, loss_keys: %s, "
                     "selections: %s, avg_samples: %s, smooth_amount: %s, flatten_outliers: %s)",
                     self.__class__.__name__, session_id, display, loss_keys, selections,
                     avg_samples, smooth_amount, flatten_outliers)
        try:
            smooth_amount = self.vars["smoothgraph"].get()
        except tk.TclError:
            # Don't update when there is no value in the variable
            return
              self.add_child(tabname, data)
  
      def smooth_amount_callback(self, *args):
          """ Update each graph's smooth amount on variable change """
        try:
            smooth_amount = self.vars["smoothgraph"].get()
        except tk.TclError:
            # Don't update when there is no value in the variable
            return
          logger.debug("Updating graph smooth_amount: (new_value: %s, args: %s)",
                       smooth_amount, args)
          for graph in self.subnotebook.children.values():
              graph.calcs.args["smooth_amount"] = smooth_amount
  
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