  
      def _set_resize_callback(self):
          """ Sets the resize callback if displaying preview at actual size or removes it if
          displaying at screen-fit size. """
          if self._full_size:
              logger.debug("Setting resize callback for actual size display")
              for fig, size in self._images.values():
                  self._resize_ids.append((fig, fig.canvas.mpl_connect("resize_event",
                                                                       self._on_resize)))
                  fig.set_size_inches(size)
 
</s> remove     @property
    def _toggle_size(self) -> bool:
        return self._full_size

    @_toggle_size.setter
    def _toggle_size(self, value: bool) -> None:  # pylint:disable=unused-argument
        """ Toggle between actual size and screen-fit size.

        Parameters
        ----------
        value: bool
            Unused, but required for setter. The size will check the previous state and switch it
            to the opposite state
        """
        self._full_size = not self._full_size
 </s> add     def _toggle_size(self) -> None:  # pylint:disable=unused-argument
        """ Toggle between actual size and screen-fit size. """
        self._triggers["full_size"] = not self._triggers["full_size"] </s> remove                         if self._full_size:  # This can only be true if preview was closed
 </s> add                         if self._triggers["full_size"]:  # Can only be true if preview was closed </s> remove         then resets :attr:`_toggle_mask` back to ``False``
 </s> add         then resets mask toggle back to ``False`` </s> remove             setattr(self, self._callbacks[key], True)
 </s> add             if key == "f":
                self._toggle_size()
            else:
                self._triggers[self._callbacks[key]] = True </s> remove                 logger.debug("Generated preview for GUI: '%s'", img)
 </s> add                 logger.debug("Generated preview for GUI: '%s'", imgfile)
        if self._triggers["full_size"]:
  
      def _set_resize_callback(self):
          """ Sets the resize callback if displaying preview at actual size or removes it if
          displaying at screen-fit size. """
        if self._triggers["full_size"]:
              logger.debug("Setting resize callback for actual size display")
              for fig, size in self._images.values():
                  self._resize_ids.append((fig, fig.canvas.mpl_connect("resize_event",
                                                                       self._on_resize)))
                  fig.set_size_inches(size)
keep keep keep keep replace keep keep keep keep keep
 bugfix: Update preview screen in GUI 
scripts/train.py