Skip to content

Commit 3f3cae3

Browse files
[CodeStyle][Typos][S-[15-19]] Fix typo(setted, shoule, similary, simplier, szie) (#7653)
* [CodeStyle][Typos][S-[15-19]] Fix typo * Update docs/practices/nlp/transformer_in_English-to-Spanish.ipynb --------- Co-authored-by: ooo oo <[email protected]>
1 parent b404b4d commit 3f3cae3

File tree

10 files changed

+17
-23
lines changed

10 files changed

+17
-23
lines changed

_typos.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,5 @@ datas = "datas"
2828
feeded = "feeded"
2929

3030
# These words need to be fixed
31-
setted = "setted"
32-
shoule = "shoule"
33-
similary = "similary"
34-
simplier = "simplier"
3531
softwares = "softwares"
36-
sperated = "sperated"
3732
splitted = "splitted"
38-
szie = "szie"

ci_scripts/ci_start.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export DIR_PATH=${PWD}
44
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
55
source ${SCRIPT_DIR}/utils.sh
66
set +x
7-
# 1 decide PADDLE_WHL if not setted.
7+
# 1 decide PADDLE_WHL if not set.
88
if [ -z "${PADDLE_WHL}" ] ; then
99
docs_pr_info=$(get_repo_pr_info "PaddlePaddle/docs" ${GIT_PR_ID})
1010
paddle_pr_id=$(get_paddle_pr_num_from_docs_pr_info ${docs_pr_info})
@@ -48,16 +48,16 @@ if [ "${BUILD_DOC}" = "true" ] && [ -x /usr/local/bin/sphinx-build ] ; then
4848
fi
4949

5050
is_shell_attribute_set x
51-
xdebug_setted=$?
52-
if [ $xdebug_setted ] ; then
51+
xdebug_set=$?
52+
if [ $xdebug_set ] ; then
5353
set +x
5454
fi
5555
# clean git workspace
5656
cd ${SCRIPT_DIR}/..
5757
git reset --hard && git clean -dfx
5858
cd ${DIR_PATH}
5959

60-
if [ $xdebug_setted ] ; then
60+
if [ $xdebug_set ] ; then
6161
set -x
6262
fi
6363

ci_scripts/ci_start_en.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ source ${SCRIPT_DIR}/utils.sh
66
export OUTPUTDIR=/docs
77
export VERSIONSTR=$(echo ${BRANCH} | sed 's@release/@@g')
88

9-
# 1 decide PADDLE_WHL if not setted.
9+
# 1 decide PADDLE_WHL if not set.
1010
if [ -z "${PADDLE_WHL}" ] ; then
1111
# docs_pr_info=$(get_repo_pr_info "PaddlePaddle/docs" ${GIT_PR_ID})
1212
paddle_pr_id=${GIT_PR_ID}
@@ -51,8 +51,8 @@ if [ "${BUILD_DOC}" = "true" ] && [ -x /usr/local/bin/sphinx-build ] ; then
5151
fi
5252

5353
is_shell_attribute_set x
54-
xdebug_setted=$?
55-
if [ $xdebug_setted ] ; then
54+
xdebug_set=$?
55+
if [ $xdebug_set ] ; then
5656
set +x
5757
fi
5858
# clean git workspace
@@ -64,7 +64,7 @@ if [ "${BUILD_DOC}" = "true" ] && [ -x /usr/local/bin/sphinx-build ] ; then
6464
echo "Ak = ${BOS_CREDENTIAL_AK}" >> ${BCECMD_CONFIG}/credentials
6565
echo "Sk = ${BOS_CREDENTIAL_SK}" >> ${BCECMD_CONFIG}/credentials
6666
fi
67-
if [ $xdebug_setted ] ; then
67+
if [ $xdebug_set ] ; then
6868
set -x
6969
fi
7070

docs/design/concurrent/select_op.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ creating a ***select_op***.
1414
## How to use it
1515

1616
The **select_op** is available as a c++ operator. However most users
17-
will prefer to use the much simplier Python API.
17+
will prefer to use the much simpler Python API.
1818

1919
- **fluid.Select()**: Creates a select operator and adds it to the current
2020
block within the main program. Also creates a sub block and adds it to the

docs/design/others/auto_gradient_check.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Background:
44
- Generally, it is easy to check whether the forward computation of an Operator is correct or not. However, backpropagation is a notoriously difficult algorithm to debug and get right because of the following challenges:
55
1. The formula for backpropagation formula should be correct according to the forward computation.
6-
2. The Implementation of the above shoule be correct in CPP.
6+
2. The Implementation of the above should be correct in CPP.
77
3. It is difficult to prepare an unbiased test data.
88

99
- Auto gradient checking gets a numerical gradient using forward Operator and uses it as a reference for the backward Operator's result. It has several advantages:

docs/design/others/gan_api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class DCGAN:
153153
self.d_loss_fake = pd.reduce_mean(pd.cross_entropy(self.D_f, np.zeros(self.batch_size))
154154
self.d_loss = self.d_loss_real + self.d_loss_fake
155155

156-
self.g_loss = pd.reduce_mean(pd.cross_entropy(self.D_f, np.ones(self.batch_szie))
156+
self.g_loss = pd.reduce_mean(pd.cross_entropy(self.D_f, np.ones(self.batch_size))
157157
```
158158

159159
If we do not have dependency engine but blocks, the module building our GAN model will be like this:
@@ -175,7 +175,7 @@ class DCGAN:
175175
else: # original version of GAN
176176
self.G = self.generator(self.z)
177177
self.D_g = self.discriminator(self.G, self.y)
178-
self.g_loss = pd.reduce_mean(pd.cross_entropy(self.D_g, np.ones(self.batch_szie))
178+
self.g_loss = pd.reduce_mean(pd.cross_entropy(self.D_g, np.ones(self.batch_size))
179179

180180
with pd.default_block().d_block():
181181
if self.y_dim: # if conditional GAN, includes label

docs/eval/【Hackathon No.111】PR.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ show_collage(examples)
173173
```
174174
## 3.2、构建训练数据
175175

176-
图片检索的模型的训练样本跟常见的分类任务的训练样本不太一样的地方在于,每个训练样本并不是一个(image, class)这样的形式。而是(image0, image1, similary_or_not)的形式,即,每
176+
图片检索的模型的训练样本跟常见的分类任务的训练样本不太一样的地方在于,每个训练样本并不是一个(image, class)这样的形式。而是(image0, image1, similar_or_not)的形式,即,每
177177

178178
一个训练样本由两张图片组成,而其 label 是这两张图片是否相似的标志位(0 或者 1)。
179179

docs/practices/cv/image_search.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@
223223
"source": [
224224
"### 3.3 构建训练数据\n",
225225
"\n",
226-
"图片检索的模型的训练样本跟常见的分类任务的训练样本不太一样的地方在于,每个训练样本并不是一个`(image, class)`这样的形式。而是(image0, image1, similary_or_not)的形式,即,每一个训练样本由两张图片组成,而其`label`是这两张图片是否相似的标志位(0或者1)。\n",
226+
"图片检索的模型的训练样本跟常见的分类任务的训练样本不太一样的地方在于,每个训练样本并不是一个`(image, class)`这样的形式。而是(image0, image1, similar_or_not)的形式,即,每一个训练样本由两张图片组成,而其`label`是这两张图片是否相似的标志位(0或者1)。\n",
227227
"\n",
228228
"很自然的能够想到,来自同一个类别的两张图片,是相似的图片,而来自不同类别的两张图片,应该是不相似的图片。\n",
229229
"\n",

docs/practices/jit/image_search_with_jit.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
},
162162
"source": [
163163
"### 3.2 构建训练数据\n",
164-
"图片检索的模型的训练样本跟常见的分类任务的训练样本不太一样的地方在于,每个训练样本并不是一个(image, class)这样的形式。而是(image0, image1, similary_or_not)的形式,即,每一个训练样本由两张图片组成,而其label是这两张图片是否相似的标志位(0或者1)。\n",
164+
"图片检索的模型的训练样本跟常见的分类任务的训练样本不太一样的地方在于,每个训练样本并不是一个(image, class)这样的形式。而是(image0, image1, similar_or_not)的形式,即,每一个训练样本由两张图片组成,而其label是这两张图片是否相似的标志位(0或者1)。\n",
165165
"\n",
166166
"很自然的能够想到,来自同一个类别的两张图片,是相似的图片,而来自不同类别的两张图片,应该是不相似的图片。\n",
167167
"\n",

docs/practices/nlp/transformer_in_English-to-Spanish.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,7 @@
11701170
"source": [
11711171
"### 4.2 Encoder\n",
11721172
"Encoder部分主要包含了多头注意力机制、归一化层以及前馈神经网络。输入会依次经过多头注意力模块、归一化层构成的残差模块、前馈神经网络模块、归一化层构成的残差模块。\n",
1173-
"* 多头注意力机制(MultiHeadAttention):使用[paddle.nn.MultiHeadAttention](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/nn/MultiHeadAttention_cn.html#multiheadattention)实现多头注意力机制,需要注意其掩码attn_mask需要的shape是[batch_szie,num_heads,sequence_length,sequence_length]。\n",
1173+
"* 多头注意力机制(MultiHeadAttention):使用[paddle.nn.MultiHeadAttention](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/nn/MultiHeadAttention_cn.html#multiheadattention)实现多头注意力机制,需要注意其掩码attn_mask需要的shape是[batch_size,num_heads,sequence_length,sequence_length]。\n",
11741174
"* 前馈神经网络(Feed Forward):输入经过MultiHeadAttention层后,经过一层feed forward层。模型中的feed forward,采用的是一种position-wise feed-forward的方法,即先对输入加一个全连接网络,之后使用Relu激活,之后再加一个全连接网络。\n",
11751175
"* 残差网络:由归一化(LayerNorm)后的结果与之前时刻的输入相加组成。LayerNorm会在每一个样本上计算均值和方差。\n"
11761176
]
@@ -1492,7 +1492,7 @@
14921492
" cost = paddle.squeeze(cost, axis=[2])\n",
14931493
"\n",
14941494
" # trg_mask 的形状[batch_size,suqence_len]\n",
1495-
" # * 这个星号应该是对应位置相乘,返回结果的形状 [bathc_szie,sequence_len]\n",
1495+
" # * 这个星号应该是对应位置相乘,返回结果的形状 [batch_size,sequence_len]\n",
14961496
" masked_cost = cost * trg_mask\n",
14971497
"\n",
14981498
" return paddle.mean(masked_cost)"

0 commit comments

Comments
 (0)