              to smoothed
          """
          logger.debug("Popping up data window")
          scaling_factor = get_config().scaling_factor
          toplevel = SessionPopUp(self.session.modeldir,
                                  self.session.modelname,
                                  self.selected_id.get(),
                                  datapoints)
          toplevel.title(self.data_popup_title())
          toplevel.tk.call(
              'wm',
              'iconphoto',
              toplevel._w, get_images().icons["favicon"])  # pylint:disable=protected-access
          position = self.data_popup_get_position()
 
</s> remove         position = self.data_popup_get_position()
 </s> add         position = self._data_popup_get_position() </s> remove             The default view is rolling average over 500 points.
            If there are fewer data points than this, switch the default
            to smoothed
 </s> add         The default view is rolling average over 500 points. If there are fewer data points than
        this, switch the default to smoothed,

        Parameters
        ----------
        data_points: int
            The number of iterations that are to be plotted </s> remove     def calc_smoothed(self, data):
        """ Smooth the data """
        last = data[0]  # First value in the plot (first time step)
        weight = self.args["smooth_amount"]
        smoothed = list()
        for point in data:
            smoothed_val = last * weight + (1 - weight) * point  # Calculate smoothed value
            smoothed.append(smoothed_val)                        # Save it
            last = smoothed_val                                  # Anchor the last smoothed value

        return smoothed

    @staticmethod
    def calc_trend(data):
        """ Compile trend data """
 </s> add     def _calc_smoothed(self, data):
        """ Smooth the data.

        Parameters
        ----------
        data: :class:`numpy.ndarray`
            The data to smoothen

        Returns
        -------
        :class:`numpy.ndarray`
            The smoothed data
        """
        return ExponentialMovingAverage(data, self._args["smooth_amount"])()

    @classmethod
    def _calc_trend(cls, data):
        """ Calculate polynomial trend of the given data.

        Parameters
        ----------
        data: :class:`numpy.ndarray`
            The data to calculate the trend for

        Returns
        -------
        :class:`numpy.ndarray`
            The trend for the given data
        """ </s> remove     def data_popup(self, datapoints):
 </s> add     def _data_popup(self, data_points): </s> remove     def add_option_smoothing(self):
        """ Add refresh button to refresh graph immediately """
 </s> add     def _add_option_raw(self):
        """ Add check-button to hide/display raw data """
        logger.debug("Adding display raw option")
        tk_var = self.vars["raw_data"]
        chkbtn = ttk.Checkbutton(
            self.optsframe,
            variable=tk_var,
            text="Raw",
            command=lambda v=tk_var: self._display_data_callback("raw", v))
        chkbtn.pack(side=tk.RIGHT, padx=5, anchor=tk.W)
        Tooltip(chkbtn, text="Display the raw loss data", wraplength=200)

    def _add_option_smoothed(self):
        """ Add check-button to hide/display smoothed data """
        logger.debug("Adding display smoothed option")
        tk_var = self.vars["smooth_data"]
        chkbtn = ttk.Checkbutton(
            self.optsframe,
            variable=tk_var,
            text="Smoothed",
            command=lambda v=tk_var: self._display_data_callback("smoothed", v))
        chkbtn.pack(side=tk.RIGHT, padx=5, anchor=tk.W)
        Tooltip(chkbtn, text="Display the smoothed loss data", wraplength=200)

    def _add_option_smoothing(self):
        """ Add a slider to adjust the smoothing amount """
        toplevel = SessionPopUp(self._selected_id.get(),
                                data_points)
        toplevel.title(self._data_popup_title())
              to smoothed
          """
          logger.debug("Popping up data window")
          scaling_factor = get_config().scaling_factor
        toplevel = SessionPopUp(self._selected_id.get(),
                                data_points)
        toplevel.title(self._data_popup_title())
        toplevel = SessionPopUp(self._selected_id.get(),
                                data_points)
        toplevel.title(self._data_popup_title())
        toplevel = SessionPopUp(self._selected_id.get(),
                                data_points)
        toplevel.title(self._data_popup_title())
        toplevel = SessionPopUp(self._selected_id.get(),
                                data_points)
        toplevel.title(self._data_popup_title())
        toplevel = SessionPopUp(self._selected_id.get(),
                                data_points)
        toplevel.title(self._data_popup_title())
          toplevel.tk.call(
              'wm',
              'iconphoto',
              toplevel._w, get_images().icons["favicon"])  # pylint:disable=protected-access
          position = self.data_popup_get_position()
keep keep keep keep replace 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/display_analysis.py