def _progressbar(self, msg, iter_num):
        """Display a progress bar with current loss.

        Parameters
        ----------
        msg : str
            Message to print alongside the progress bar

        iter_num : int
            Iteration number.
            Progress is only printed if this is a multiple of
            `self.display_progress`.

        """
        if self.display_progress and \
                                (iter_num + 1) % self.display_progress == 0:
            sys.stderr.write('\r')
            sys.stderr.write("Iteration {}: {}".format(iter_num + 1, msg))
            sys.stderr.flush()
Display a progress bar with current loss.

        Parameters
        ----------
        msg : str
            Message to print alongside the progress bar

        iter_num : int
            Iteration number.
            Progress is only printed if this is a multiple of
            `self.display_progress`.