Skip to content

Commit

Permalink
fix docs bugs (#6540)
Browse files Browse the repository at this point in the history
  • Loading branch information
li-yiqing authored Mar 27, 2024
1 parent 4946ad7 commit 8ab1cbd
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/api/paddle/incubate/nn/FusedMultiHeadAttention_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ FusedMultiHeadAttention
- **dropout_rate** (float,可选) - Multi-Head Attention 后面的 dropout 算子的注意力目标的随机失活率。0 表示进行 dropout 计算。默认值:0.5。
- **attn_dropout_rate** (float,可选) - Multi-Head Attention 中的 dropout 算子的注意力目标的随机失活率。0 表示不进行 dropout 计算。默认值:0.5。
- **kdim** (int,可选) - 键值对中 key 的维度。如果为 ``None`` 则 ``kdim = embed_dim``。默认值 ``None`` 。
- **vdim** (int,可选) - 键值对中 value 的维度。如果为 ``None`` 则 ``kdim = embed_dim``。默认值:``None`` 。
- **vdim** (int,可选) - 键值对中 value 的维度。如果为 ``None`` 则 ``vdim = embed_dim``。默认值:``None`` 。
- **normalize_before** (bool,可选) - 是 pre_layer_norm 结构(True)还是 post_layer_norm 结构(False)。pre_layer_norm 结构中,``layer_norm`` 算子位于 multi-head attention 和 ffn 的前面,post_layer_norm 结构中,``layer_norm`` 位于两者的后面。默认值:``False`` 。
- **need_weights** (bool,可选) - 表明是否返回注意力权重。默认值:``False`` 。
- **qkv_weight_attr** (ParamAttr,可选) - 为 Attention 中计算 q, k, v 时的计算指定权重参数属性的对象。默认值:``None``,表示使用默认的权重参数属性。具体用法请参见 :ref:`cn_api_paddle_ParamAttr` 。
Expand Down
2 changes: 1 addition & 1 deletion docs/api/paddle/io/DataLoader_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ DataLoader 当前支持 ``map-style`` 和 ``iterable-style`` 的数据集,``ma
- **num_workers** (int,可选) - 用于加载数据的子进程个数,若为 0 即为不开启子进程,在主进程中进行数据加载。默认值为 0。
- **use_buffer_reader** (bool,可选) - 是否使用缓存读取器。若 ``use_buffer_reader`` 为 True,DataLoader 会异步地预读取一定数量(默认读取下一个)的 mini-batch 的数据,可加速数据读取过程,但同时会占用少量的 CPU/GPU 存储,即一个 batch 输入数据的存储空间。默认值为 True。
- **prefetch_factor** (int,可选) - 缓存的 mini-batch 的个数。若 ``use_buffer_reader`` 为 True,DataLoader 会异步地预读取 ``prefetch_factor`` 个 mini-batch。默认值为 2。
- **use_shared_memory** (bool,可选) - 是否使用共享内存来提升子进程将数据放入进程间队列的速度,该参数尽在多进程模式下有效(即 ``num_workers > 0`` ),请确认机器上有足够的共享内存空间(如 Linux 系统下 ``/dev/shm/`` 目录空间大小)再设置此参数。默认为 True。
- **use_shared_memory** (bool,可选) - 是否使用共享内存来提升子进程将数据放入进程间队列的速度,该参数仅在多进程模式下有效(即 ``num_workers > 0`` ),请确认机器上有足够的共享内存空间(如 Linux 系统下 ``/dev/shm/`` 目录空间大小)再设置此参数。默认为 True。
- **timeout** (int,可选) - 从子进程输出队列获取 mini-batch 数据的超时时间。默认值为 0。
- **worker_init_fn** (callable,可选) - 子进程初始化函数,此函数会被子进程初始化时被调用,并传递 ``worker id`` 作为参数。默认值为 None。

Expand Down
2 changes: 1 addition & 1 deletion docs/api/paddle/nn/MultiHeadAttention_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ MultiHeadAttention
- **num_heads** (int) - 多头注意力机制的 Head 数量。
- **dropout** (float,可选) - 注意力目标的随机失活率。0 表示不加 dropout。默认值:0。
- **kdim** (int,可选) - 键值对中 key 的维度。如果为 ``None`` 则 ``kdim = embed_dim``。默认值:``None``。
- **vdim** (int,可选) - 键值对中 value 的维度。如果为 ``None`` 则 ``kdim = embed_dim``。默认值:``None``。
- **vdim** (int,可选) - 键值对中 value 的维度。如果为 ``None`` 则 ``vdim = embed_dim``。默认值:``None``。
- **need_weights** (bool,可选) - 表明是否返回注意力权重。默认值:``False``。
- **weight_attr** (ParamAttr,可选) - 指定权重参数属性的对象。默认值:``None``,表示使用默认的权重参数属性。具体用法请参见 :ref:`cn_api_paddle_ParamAttr` 。
- **bias_attr** (ParamAttr,可选)- 指定偏置参数属性的对象。默认值:``None``,表示使用默认的偏置参数属性。具体用法请参见 :ref:`cn_api_paddle_ParamAttr` 。
Expand Down
4 changes: 2 additions & 2 deletions docs/practices/cv/image_classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
},
"source": [
"## 二、数据加载\n",
"手写数字的MNIST数据集,包含60,000个用于训练的示例和10,000个用于测试的示例。这些数字已经过尺寸标准化并位于图像中心,图像是固定大小(28x28像素),其值为0到1。该数据集的官方地址为:http://yann.lecun.com/exdb/mnist 。\n",
"手写数字的MNIST数据集,包含60,000个用于训练的示例和10,000个用于测试的示例。这些数字已经过尺寸标准化并位于图像中心,图像是固定大小(28x28像素),其值为0到9。该数据集的官方地址为:http://yann.lecun.com/exdb/mnist 。\n",
"\n",
"我们使用飞桨框架自带的 ``paddle.vision.datasets.MNIST`` 完成mnist数据集的加载。"
]
Expand Down Expand Up @@ -100,7 +100,7 @@
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAJIAAACPCAYAAAARM4LLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAACHBJREFUeJzt3V1oVOkZB/D/42j8ql9pZInZYBYVIRT8INYWi0atH13Q4E2JilZZWC/8aMFgTb3QCy+KQi803ixWUrGmFGvYtSwEXcyFuEgSDDbZNasuxs3i1yJq0QtdeXsxx+k8B5M5mXnmnDOZ/w9Czv+cZM4LPr7zzjmTZ8Q5B6JcjYp6ADQysJDIBAuJTLCQyAQLiUywkMgEC4lMsJDIRE6FJCJrRaRPRG6LyH6rQVHhkWyvbItIAsA3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yAH1Rji9tXJ8CWBXX8TnnQn1qqwDwXVoe8PbFSex6hxdKb3Mutgfhkv/tI31Jm21v8yiEWUjfA6hMy+97++IkUO/wMOTS2zwKYRZSB4A5IvKBiJQAqEeyV3ecvO0dDkTYOzxAb3Mgbr3NQ140fgjgGwB3AByIeAHbguSH9bxGcr32EYCfIvlq6BaASwBKIxrbr5B82roBoNv7+jAu43vXF69skwkutskEC4lMsJDIBAuJTLCQyAQLiUywkMgEC4lM/A+jN2A4bkW+2gAAAABJRU5ErkJggg==",
"text/plain": [
"<Figure size 144x144 with 1 Axes>"
]
Expand Down
2 changes: 1 addition & 1 deletion docs/practices/quick_start/save_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
},
"source": [
"## 三、数据集\n",
"手写数字的MNIST数据集,包含60,000个用于训练的示例和10,000个用于测试的示例。这些数字已经过尺寸标准化并位于图像中心,图像是固定大小(28x28像素),其值为0到1。该数据集的官方地址为:http://yann.lecun.com/exdb/mnist/\n",
"手写数字的MNIST数据集,包含60,000个用于训练的示例和10,000个用于测试的示例。这些数字已经过尺寸标准化并位于图像中心,图像是固定大小(28x28像素),其值为0到9。该数据集的官方地址为:http://yann.lecun.com/exdb/mnist/\n",
"本例中使用飞桨自带的mnist数据集。使用from paddle.vision.datasets import MNIST 引入即可。"
]
},
Expand Down

0 comments on commit 8ab1cbd

Please sign in to comment.