From 061307e25c1e633cb26d0694f58d010d331bc044 Mon Sep 17 00:00:00 2001 From: tink2123 Date: Wed, 15 Apr 2020 18:05:15 +0800 Subject: [PATCH] fix diff from en and cn --- doc/fluid/api_cn/layers_cn/multiclass_nms_cn.rst | 4 ++-- doc/fluid/api_cn/layers_cn/noam_decay_cn.rst | 6 ++---- doc/fluid/api_cn/layers_cn/yolo_box_cn.rst | 4 ++-- doc/fluid/api_cn/layers_cn/yolov3_loss_cn.rst | 8 ++++---- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/doc/fluid/api_cn/layers_cn/multiclass_nms_cn.rst b/doc/fluid/api_cn/layers_cn/multiclass_nms_cn.rst index 7dc576160..7abcdbdf0 100644 --- a/doc/fluid/api_cn/layers_cn/multiclass_nms_cn.rst +++ b/doc/fluid/api_cn/layers_cn/multiclass_nms_cn.rst @@ -62,9 +62,9 @@ multiclass_nms .. code-block:: python import paddle.fluid as fluid - boxes = fluid.layers.data(name='bboxes', shape=[81, 4], + boxes = fluid.data(name='bboxes', shape=[None, 81, 4], dtype='float32', lod_level=1) - scores = fluid.layers.data(name='scores', shape=[81], + scores = fluid.data(name='scores', shape=[None, 81], dtype='float32', lod_level=1) out = fluid.layers.multiclass_nms(bboxes=boxes, scores=scores, diff --git a/doc/fluid/api_cn/layers_cn/noam_decay_cn.rst b/doc/fluid/api_cn/layers_cn/noam_decay_cn.rst index 4769b6dd7..7dc485ddc 100644 --- a/doc/fluid/api_cn/layers_cn/noam_decay_cn.rst +++ b/doc/fluid/api_cn/layers_cn/noam_decay_cn.rst @@ -37,12 +37,10 @@ noam衰减的numpy实现如下: .. code-block:: python import paddle.fluid as fluid + d_model = 0.01 warmup_steps = 100 learning_rate = 0.01 - lr = fluid.layers.learning_rate_scheduler.noam_decay( - 1/(warmup_steps *(learning_rate ** 2)), - warmup_steps) - + lr = fluid.layers.noam_decay(d_model, warmup_steps, learning_rate) diff --git a/doc/fluid/api_cn/layers_cn/yolo_box_cn.rst b/doc/fluid/api_cn/layers_cn/yolo_box_cn.rst index c12807937..debf4727c 100644 --- a/doc/fluid/api_cn/layers_cn/yolo_box_cn.rst +++ b/doc/fluid/api_cn/layers_cn/yolo_box_cn.rst @@ -57,8 +57,8 @@ yolo_box .. code-block:: python import paddle.fluid as fluid - x = fluid.layers.data(name='x', shape=[255, 13, 13], dtype='float32') - img_size = fluid.layers.data(name='img_size',shape=[2],dtype='int64') + x = fluid.data(name='x', shape=[None, 255, 13, 13], dtype='float32') + img_size = fluid.data(name='img_size',shape=[None, 2],dtype='int64') anchors = [10, 13, 16, 30, 33, 23] boxes, scores = fluid.layers.yolo_box(x=x, img_size=img_size, class_num=80, anchors=anchors, conf_thresh=0.01, downsample_ratio=32) diff --git a/doc/fluid/api_cn/layers_cn/yolov3_loss_cn.rst b/doc/fluid/api_cn/layers_cn/yolov3_loss_cn.rst index 6b210e83a..e084649a5 100644 --- a/doc/fluid/api_cn/layers_cn/yolov3_loss_cn.rst +++ b/doc/fluid/api_cn/layers_cn/yolov3_loss_cn.rst @@ -85,10 +85,10 @@ yolov3 loss前的网络输出形状为[N,C,H,W],H和W应该相同,用 .. code-block:: python import paddle.fluid as fluid - x = fluid.layers.data(name='x', shape=[255, 13, 13], dtype='float32') - gt_box = fluid.layers.data(name='gt_box', shape=[6, 4], dtype='float32') - gt_label = fluid.layers.data(name='gt_label', shape=[6], dtype='int32') - gt_score = fluid.layers.data(name='gt_score', shape=[6], dtype='float32') + x = fluid.data(name='x', shape=[None, 255, 13, 13], dtype='float32') + gt_box = fluid.data(name='gt_box', shape=[None, 6, 4], dtype='float32') + gt_label = fluid.data(name='gt_label', shape=[None, 6], dtype='int32') + gt_score = fluid.data(name='gt_score', shape=[None, 6], dtype='float32') anchors = [10, 13, 16, 30, 33, 23, 30, 61, 62, 45, 59, 119, 116, 90, 156, 198, 373, 326] anchor_mask = [0, 1, 2] loss = fluid.layers.yolov3_loss(x=x, gt_box=gt_box, gt_label=gt_label, -- GitLab