Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleSeg
提交
0a4322e4
P
PaddleSeg
项目概览
PaddlePaddle
/
PaddleSeg
通知
289
Star
8
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
53
列表
看板
标记
里程碑
合并请求
3
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleSeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
53
Issue
53
列表
看板
标记
里程碑
合并请求
3
合并请求
3
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0a4322e4
编写于
9月 28, 2020
作者:
M
michaelowenliu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix indent issues in progbar.py
上级
95eb1dd6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
22 deletion
+27
-22
dygraph/paddleseg/utils/progbar.py
dygraph/paddleseg/utils/progbar.py
+27
-22
未找到文件。
dygraph/paddleseg/utils/progbar.py
浏览文件 @
0a4322e4
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录