提交 0a4322e4 编写于 作者: M michaelowenliu

fix indent issues in progbar.py

上级 95eb1dd6
...@@ -19,18 +19,20 @@ import numpy as np ...@@ -19,18 +19,20 @@ import numpy as np
class Progbar(object): class Progbar(object):
"""Displays a progress bar. """
refers to https://github.com/keras-team/keras/blob/keras-2/keras/utils/generic_utils.py Displays a progress bar.
Arguments: It refers to https://github.com/keras-team/keras/blob/keras-2/keras/utils/generic_utils.py
target: Total number of steps expected, None if unknown.
width: Progress bar width on screen. Args:
verbose: Verbosity mode, 0 (silent), 1 (verbose), 2 (semi-verbose) target (int): Total number of steps expected, None if unknown.
stateful_metrics: Iterable of string names of metrics that should *not* be width (int): Progress bar width on screen.
averaged over time. Metrics in this list will be displayed as-is. All verbose (int): Verbosity mode, 0 (silent), 1 (verbose), 2 (semi-verbose)
others will be averaged by the progbar before display. stateful_metrics (list|tuple): Iterable of string names of metrics that should *not* be
interval: Minimum visual progress update interval (in seconds). averaged over time. Metrics in this list will be displayed as-is. All
unit_name: Display name for step counts (usually "step" or "sample"). others will be averaged by the progbar before display.
""" interval (float): Minimum visual progress update interval (in seconds).
unit_name (str): Display name for step counts (usually "step" or "sample").
"""
def __init__(self, def __init__(self,
target, target,
...@@ -64,15 +66,18 @@ class Progbar(object): ...@@ -64,15 +66,18 @@ class Progbar(object):
self._last_update = 0 self._last_update = 0
def update(self, current, values=None, finalize=None): def update(self, current, values=None, finalize=None):
"""Updates the progress bar. """
Arguments: Updates the progress bar.
current: Index of current step.
values: List of tuples: `(name, value_for_last_step)`. If `name` is in Args:
`stateful_metrics`, `value_for_last_step` will be displayed as-is. current (int): Index of current step.
Else, an average of the metric over time will be displayed. values (list): List of tuples: `(name, value_for_last_step)`. If `name` is in
finalize: Whether this is the last update for the progress bar. If `stateful_metrics`, `value_for_last_step` will be displayed as-is.
`None`, defaults to `current >= self.target`. Else, an average of the metric over time will be displayed.
""" finalize (bool): Whether this is the last update for the progress bar. If
`None`, defaults to `current >= self.target`.
"""
if finalize is None: if finalize is None:
if self.target is None: if self.target is None:
finalize = False finalize = False
...@@ -200,4 +205,4 @@ class Progbar(object): ...@@ -200,4 +205,4 @@ class Progbar(object):
self._last_update = now self._last_update = now
def add(self, n, values=None): def add(self, n, values=None):
self.update(self._seen_so_far + n, values) self.update(self._seen_so_far + n, values)
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册