Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
572cc8bd
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
572cc8bd
编写于
2月 24, 2021
作者:
Q
qingqing01
提交者:
GitHub
2月 24, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update doc for 2.0 API and some callback (#31180)
test=document_fix
上级
00b09e86
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
27 addition
and
21 deletion
+27
-21
python/paddle/fluid/layers/detection.py
python/paddle/fluid/layers/detection.py
+20
-18
python/paddle/hapi/callbacks.py
python/paddle/hapi/callbacks.py
+7
-3
未找到文件。
python/paddle/fluid/layers/detection.py
浏览文件 @
572cc8bd
...
@@ -2214,17 +2214,18 @@ def multi_box_head(inputs,
...
@@ -2214,17 +2214,18 @@ def multi_box_head(inputs,
Examples 1: set min_ratio and max_ratio:
Examples 1: set min_ratio and max_ratio:
.. code-block:: python
.. code-block:: python
import paddle.fluid as fluid
import paddle
paddle.enable_static()
images =
fluid
.data(name='data', shape=[None, 3, 300, 300], dtype='float32')
images =
paddle.static
.data(name='data', shape=[None, 3, 300, 300], dtype='float32')
conv1 =
fluid
.data(name='conv1', shape=[None, 512, 19, 19], dtype='float32')
conv1 =
paddle.static
.data(name='conv1', shape=[None, 512, 19, 19], dtype='float32')
conv2 =
fluid
.data(name='conv2', shape=[None, 1024, 10, 10], dtype='float32')
conv2 =
paddle.static
.data(name='conv2', shape=[None, 1024, 10, 10], dtype='float32')
conv3 =
fluid
.data(name='conv3', shape=[None, 512, 5, 5], dtype='float32')
conv3 =
paddle.static
.data(name='conv3', shape=[None, 512, 5, 5], dtype='float32')
conv4 =
fluid
.data(name='conv4', shape=[None, 256, 3, 3], dtype='float32')
conv4 =
paddle.static
.data(name='conv4', shape=[None, 256, 3, 3], dtype='float32')
conv5 =
fluid
.data(name='conv5', shape=[None, 256, 2, 2], dtype='float32')
conv5 =
paddle.static
.data(name='conv5', shape=[None, 256, 2, 2], dtype='float32')
conv6 =
fluid
.data(name='conv6', shape=[None, 128, 1, 1], dtype='float32')
conv6 =
paddle.static
.data(name='conv6', shape=[None, 128, 1, 1], dtype='float32')
mbox_locs, mbox_confs, box, var =
fluid.layers
.multi_box_head(
mbox_locs, mbox_confs, box, var =
paddle.static.nn
.multi_box_head(
inputs=[conv1, conv2, conv3, conv4, conv5, conv6],
inputs=[conv1, conv2, conv3, conv4, conv5, conv6],
image=images,
image=images,
num_classes=21,
num_classes=21,
...
@@ -2239,17 +2240,18 @@ def multi_box_head(inputs,
...
@@ -2239,17 +2240,18 @@ def multi_box_head(inputs,
Examples 2: set min_sizes and max_sizes:
Examples 2: set min_sizes and max_sizes:
.. code-block:: python
.. code-block:: python
import paddle.fluid as fluid
import paddle
paddle.enable_static()
images =
fluid
.data(name='data', shape=[None, 3, 300, 300], dtype='float32')
images =
paddle.static
.data(name='data', shape=[None, 3, 300, 300], dtype='float32')
conv1 =
fluid
.data(name='conv1', shape=[None, 512, 19, 19], dtype='float32')
conv1 =
paddle.static
.data(name='conv1', shape=[None, 512, 19, 19], dtype='float32')
conv2 =
fluid
.data(name='conv2', shape=[None, 1024, 10, 10], dtype='float32')
conv2 =
paddle.static
.data(name='conv2', shape=[None, 1024, 10, 10], dtype='float32')
conv3 =
fluid
.data(name='conv3', shape=[None, 512, 5, 5], dtype='float32')
conv3 =
paddle.static
.data(name='conv3', shape=[None, 512, 5, 5], dtype='float32')
conv4 =
fluid
.data(name='conv4', shape=[None, 256, 3, 3], dtype='float32')
conv4 =
paddle.static
.data(name='conv4', shape=[None, 256, 3, 3], dtype='float32')
conv5 =
fluid
.data(name='conv5', shape=[None, 256, 2, 2], dtype='float32')
conv5 =
paddle.static
.data(name='conv5', shape=[None, 256, 2, 2], dtype='float32')
conv6 =
fluid
.data(name='conv6', shape=[None, 128, 1, 1], dtype='float32')
conv6 =
paddle.static
.data(name='conv6', shape=[None, 128, 1, 1], dtype='float32')
mbox_locs, mbox_confs, box, var =
fluid.layers
.multi_box_head(
mbox_locs, mbox_confs, box, var =
paddle.static.nn
.multi_box_head(
inputs=[conv1, conv2, conv3, conv4, conv5, conv6],
inputs=[conv1, conv2, conv3, conv4, conv5, conv6],
image=images,
image=images,
num_classes=21,
num_classes=21,
...
...
python/paddle/hapi/callbacks.py
浏览文件 @
572cc8bd
...
@@ -298,13 +298,15 @@ class Callback(object):
...
@@ -298,13 +298,15 @@ class Callback(object):
class
ProgBarLogger
(
Callback
):
class
ProgBarLogger
(
Callback
):
"""
"""
Logger callback function.
Logger callback function to print loss and metrics to stdout. It supports
silent mode (not print), progress bar or one line per each printing,
see arguments for more detailed.
Args:
Args:
log_freq (int): The frequency, in number of steps,
log_freq (int): The frequency, in number of steps,
the logs such as loss, metrics are printed. Default: 1.
the logs such as loss, metrics are printed. Default: 1.
verbose (int): The verbosity mode, should be 0, 1, or 2.
verbose (int): The verbosity mode, should be 0, 1, or 2.
0 = silent, 1 = progress bar, 2 = one line
per epoch, 3 = 2 +
0 = silent, 1 = progress bar, 2 = one line
each printing, 3 = 2 +
time counter, such as average reader cost, samples per second.
time counter, such as average reader cost, samples per second.
Default: 2.
Default: 2.
...
@@ -528,7 +530,9 @@ class ProgBarLogger(Callback):
...
@@ -528,7 +530,9 @@ class ProgBarLogger(Callback):
class
ModelCheckpoint
(
Callback
):
class
ModelCheckpoint
(
Callback
):
"""
"""
Model checkpoint callback function.
Model checkpoint callback function to save model weights and optimizer
state during training in conjunction with model.fit(). Currently,
ModelCheckpoint only supports saving after a fixed number of epochs.
Args:
Args:
save_freq(int): The frequency, in number of epochs, the model checkpoint
save_freq(int): The frequency, in number of epochs, the model checkpoint
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录