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 7dc576160b68917901ddbc71649fc94eb9fb118f..7abcdbdf0078ac3962d92b6fedff055382a8ac18 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 4769b6dd7192b523fad7528a6bc0fe30773a2991..7dc485ddc33c4ee9b49e4148730ed2af0c66428b 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 c128079379940ee08a266b653bff4edc6c4b8dea..debf4727c79ed9e274fcf183f4f4dec2ded4adf4 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 6b210e83a985319f78a510a015ceb5275806f2e5..e084649a524a95140c67e2f40c36c38c1f2a25fd 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,