diff --git a/_typos.toml b/_typos.toml index 50f9018e38c..57d2a9c38f4 100644 --- a/_typos.toml +++ b/_typos.toml @@ -31,16 +31,9 @@ Classfication = "Classfication" Comparision = "Comparision" Contructing = "Contructing" Creenshot = "Creenshot" -DELCARE = "DELCARE" -Dateset = "Dateset" -Discription = "Discription" -Distrbuted = "Distrbuted" -Driect = "Driect" Embeddding = "Embeddding" Embeding = "Embeding" Engish = "Engish" -Fasle = "Fasle" -Flase = "Flase" Generater = "Generater" Gloabal = "Gloabal" Imporvement = "Imporvement" @@ -114,20 +107,6 @@ correspoinding = "correspoinding" corss = "corss" creatation = "creatation" creats = "creats" -dafault = "dafault" -datas = "datas" -decribe = "decribe" -decribes = "decribes" -deocder = "deocder" -desgin = "desgin" -desginated = "desginated" -desigin = "desigin" -determinated = "determinated" -diffcult = "diffcult" -dimention = "dimention" -dimentions = "dimentions" -dirrectories = "dirrectories" -disucssion = "disucssion" egde = "egde" enviornment = "enviornment" erros = "erros" diff --git a/docs/api/paddle/static/IpuStrategy_cn.rst b/docs/api/paddle/static/IpuStrategy_cn.rst index 1ed286eb448..4223f92778a 100644 --- a/docs/api/paddle/static/IpuStrategy_cn.rst +++ b/docs/api/paddle/static/IpuStrategy_cn.rst @@ -46,7 +46,7 @@ set_pipelining_config(self, enable_pipelining, batches_per_step, enable_gradient - **enable_pipelining** (bool,可选)- 是否使能子图之间的数据流水线。仅支持当 enable_manual_shard=True 时,enable_pipelining 可以置为 True。默认值为 False,表示不使能该功能。 - **batches_per_step** (int,可选)- 指定数据流水线每次运算多少个 batch 的数据。默认值为 1,表示不使能数据流水线功能。 - - **enable_gradient_accumulation** (bool,可选)- 是否使能梯度累积,只用于训练模式。默认值为 Flase,表示不使能梯度累积功能。 + - **enable_gradient_accumulation** (bool,可选)- 是否使能梯度累积,只用于训练模式。默认值为 False,表示不使能梯度累积功能。 - **accumulation_factor** (int,可选)- 指定累积运算多少个 batch 更新一次权重。默认值为 1,表示不使能权重累积更新功能。 **代码示例** diff --git a/docs/design/concepts/tensor.md b/docs/design/concepts/tensor.md index 3fdd8b35de2..e38e67940a9 100644 --- a/docs/design/concepts/tensor.md +++ b/docs/design/concepts/tensor.md @@ -116,12 +116,12 @@ Before writing code, please make sure you already look through Majel Source Code ### Memory Management -`Allocation` manages a block of memory in device(CPU/GPU). We use `Place` to decribe memory location. The details of memory allocation and deallocation are implememted in `Allocator` and `DeAllocator`. Related low-level API such as `hl_malloc_device()` and `hl_malloc_host()` are provided by Paddle. +`Allocation` manages a block of memory in device(CPU/GPU). We use `Place` to describe memory location. The details of memory allocation and deallocation are implememted in `Allocator` and `DeAllocator`. Related low-level API such as `hl_malloc_device()` and `hl_malloc_host()` are provided by Paddle. ### Dim and Array #### Dim -`Dim` decribes the dimension information of an array. +`Dim` describes the dimension information of an array. `DDimVar` is an alias of a specializd class of boost.variant class template. diff --git a/docs/design/data_type/float16.md b/docs/design/data_type/float16.md index 4081fd6903b..a1c300171d7 100644 --- a/docs/design/data_type/float16.md +++ b/docs/design/data_type/float16.md @@ -130,7 +130,7 @@ fp16_tensor.set(tensor.astype(numpy.float16).view(numpy.uint16), GPUPlace) ``` ### Consistent API requirement -The basic inference in float16 mode requires users to feed input and obtain output both of float16 data type. However, in this way, the inference APIs are not consistent between float16 mode and float mode, and users may find it confusing and diffcult to use float16 inference since they need to do extra steps to provide float16 input data and convert float16 output data back to float. To have consistent API for different inference modes, we need to transpile the program desc in some way so that we can run float16 inference by feeding and fetching variables of float data type. +The basic inference in float16 mode requires users to feed input and obtain output both of float16 data type. However, in this way, the inference APIs are not consistent between float16 mode and float mode, and users may find it confusing and difficult to use float16 inference since they need to do extra steps to provide float16 input data and convert float16 output data back to float. To have consistent API for different inference modes, we need to transpile the program desc in some way so that we can run float16 inference by feeding and fetching variables of float data type. This problem can be solved by introducing a type-casting operator which takes an input variable of certain data type, cast it to another specified data type, and put the casted data into the output variable. Insert cast operator where needed can make a program internally run in float16 mode. diff --git a/docs/design/dist_train/mpi_enabled_design.md b/docs/design/dist_train/mpi_enabled_design.md index 4ad3afc7b75..dcc3d78559a 100644 --- a/docs/design/dist_train/mpi_enabled_design.md +++ b/docs/design/dist_train/mpi_enabled_design.md @@ -8,7 +8,7 @@ When we do distribute multi GPU training, the communication overhead between ser We will use OpenMPI API to PaddlePaddle, which can bring two benefits to PaddlePaddle: 1. Enable RDMA with PaddlePaddle, which bring high-performance low latency networks. -2. Enable GPUDriect with PaddlePaddle, which bring the highest throughput and lowest latency GPU read and write. +2. Enable GPUDirect with PaddlePaddle, which bring the highest throughput and lowest latency GPU read and write. # Change list * Compile args: Need add compile args to enable MPI support. diff --git a/docs/design/motivation/api.md b/docs/design/motivation/api.md index bc222564e3e..df3398ef083 100644 --- a/docs/design/motivation/api.md +++ b/docs/design/motivation/api.md @@ -26,7 +26,7 @@ Some essential concepts that our API have to provide include: As a summarization of -[our disucssion](https://github.com/PaddlePaddle/Paddle/issues/1315), +[our discussion](https://github.com/PaddlePaddle/Paddle/issues/1315), let us present two examples here: diff --git a/docs/design/others/graph.md b/docs/design/others/graph.md index 7519a65df83..e0b71950898 100644 --- a/docs/design/others/graph.md +++ b/docs/design/others/graph.md @@ -56,7 +56,7 @@ For each parameter, like W and b created by `layer.fc`, marked as double circles ## Block and Graph -The word block and graph are interchangable in the desgin of PaddlePaddle. A [Block](https://github.com/PaddlePaddle/Paddle/pull/3708) is a metaphore of the code and local variables in a pair of curly braces in programming languages, where operators are like statements or instructions. A graph of operators and variables is a representation of the block. +The word block and graph are interchangable in the design of PaddlePaddle. A [Block](https://github.com/PaddlePaddle/Paddle/pull/3708) is a metaphore of the code and local variables in a pair of curly braces in programming languages, where operators are like statements or instructions. A graph of operators and variables is a representation of the block. A Block keeps operators in an array `BlockDesc::ops` diff --git a/docs/design/phi/design_cn.md b/docs/design/phi/design_cn.md index 09b3882a7bb..39181648fe8 100644 --- a/docs/design/phi/design_cn.md +++ b/docs/design/phi/design_cn.md @@ -1134,7 +1134,7 @@ class CompatMetaTensor : public phi::MetaTensor { 通过前面介绍的 PT_INFER_META 宏归一化函数形式,然后将`PT_INFER_META(***InferMeta)`包装到一个 functor 中,functor 中先将 InferShapeContext 转换为 InferMetaContext,再调用相应 InferMeta 函数,通过一个宏统一管理代码 ``` -##define DELCARE_INFER_SHAPE_FUNCTOR(op_type, functor_name, fn) \ +##define DECLARE_INFER_SHAPE_FUNCTOR(op_type, functor_name, fn) \ struct functor_name : public paddle::framework::InferShapeBase { \ void operator()( \ paddle::framework::InferShapeContext* ctx) const override { \ @@ -1176,7 +1176,7 @@ class SignOp : public framework::OperatorWithKernel { using framework::OperatorWithKernel::OperatorWithKernel; }; -DELCARE_INFER_SHAPE_FUNCTOR( +DECLARE_INFER_SHAPE_FUNCTOR( sign, SignInferShapeFunctor, PT_INFER_META(phi::UnchangedInferMetaNew)); REGISTER_OPERATOR(sign, ops::SignOp, ops::SignOpMaker, ops::SignGradMaker, diff --git a/docs/design/phi/design_en.md b/docs/design/phi/design_en.md index 1f75fb2bf2c..9462fc967bb 100644 --- a/docs/design/phi/design_en.md +++ b/docs/design/phi/design_en.md @@ -1134,7 +1134,7 @@ Then, in order to transplant the functional `InferMeta` back to the Op architect Normalize the function form through the `PT_INFER_META` macro, and then wrap `PT_INFER_META(***InferMeta)` into a functor. The functor first converts the `InferShapeContext` to `InferMetaContext`, then calls the corresponding `InferMeta` function, and manages the code uniformly through a macro. ``` -##define DELCARE_INFER_SHAPE_FUNCTOR(op_type, functor_name, fn) \ +##define DECLARE_INFER_SHAPE_FUNCTOR(op_type, functor_name, fn) \ struct functor_name : public paddle::framework::InferShapeBase { \ void operator()( \ paddle::framework::InferShapeContext* ctx) const override { \ @@ -1176,7 +1176,7 @@ class SignOp : public framework::OperatorWithKernel { using framework::OperatorWithKernel::OperatorWithKernel; }; -DELCARE_INFER_SHAPE_FUNCTOR( +DECLARE_INFER_SHAPE_FUNCTOR( sign, SignInferShapeFunctor, PT_INFER_META(phi::UnchangedInferMetaNew)); REGISTER_OPERATOR(sign, ops::SignOp, ops::SignOpMaker, ops::SignGradMaker, diff --git a/docs/design/quantization/fixed_point_quantization.md b/docs/design/quantization/fixed_point_quantization.md index eba2db4a1c6..b5f2e1df00a 100644 --- a/docs/design/quantization/fixed_point_quantization.md +++ b/docs/design/quantization/fixed_point_quantization.md @@ -79,7 +79,7 @@ From these formulas, dequantization also can be moved before GEMM, do dequantiza Figure 2. Equivalent forward in training with simulated quantization.

-We use this equivalent workflow in the training. In our desigin, there is a quantization transpiler to insert the quantization operator and the de-quantization operator in the Fluid `ProgramDesc`. Since the outputs of quantization and de-quantization operator are still in floating point, they are called faked quantization and de-quantization operator. And the training framework is called simulated quantization. +We use this equivalent workflow in the training. In our design, there is a quantization transpiler to insert the quantization operator and the de-quantization operator in the Fluid `ProgramDesc`. Since the outputs of quantization and de-quantization operator are still in floating point, they are called faked quantization and de-quantization operator. And the training framework is called simulated quantization. #### Backward pass diff --git a/docs/dev_guides/custom_device_docs/custom_device_example_cn.md b/docs/dev_guides/custom_device_docs/custom_device_example_cn.md index bb186f98aef..e8f8f16eb7e 100644 --- a/docs/dev_guides/custom_device_docs/custom_device_example_cn.md +++ b/docs/dev_guides/custom_device_docs/custom_device_example_cn.md @@ -285,7 +285,7 @@ add_custom_command(TARGET ${PLUGIN_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/python/ COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/python/paddle-plugins/ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/lib${PLUGIN_NAME}.so ${CMAKE_CURRENT_BINARY_DIR}/python/paddle-plugins/ - COMMENT "Creating plugin dirrectories------>>>" + COMMENT "Creating plugin directories------>>>" ) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python/.timestamp diff --git a/docs/dev_guides/custom_device_docs/custom_device_example_en.md b/docs/dev_guides/custom_device_docs/custom_device_example_en.md index a0a46416af5..5c4d84c61e2 100644 --- a/docs/dev_guides/custom_device_docs/custom_device_example_en.md +++ b/docs/dev_guides/custom_device_docs/custom_device_example_en.md @@ -281,7 +281,7 @@ add_custom_command(TARGET ${PLUGIN_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/python/ COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/python/paddle-plugins/ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/lib${PLUGIN_NAME}.so ${CMAKE_CURRENT_BINARY_DIR}/python/paddle-plugins/ - COMMENT "Creating plugin dirrectories------>>>" + COMMENT "Creating plugin directories------>>>" ) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python/.timestamp diff --git a/docs/dev_guides/custom_device_docs/custom_runtime_en.rst b/docs/dev_guides/custom_device_docs/custom_runtime_en.rst index 82d8372e97f..08cd199cb4c 100644 --- a/docs/dev_guides/custom_device_docs/custom_runtime_en.rst +++ b/docs/dev_guides/custom_device_docs/custom_runtime_en.rst @@ -29,7 +29,7 @@ Device APIs +---------------------------+----------------------------------------------------------+----------+ | get_device | To get the current device | Y | +---------------------------+----------------------------------------------------------+----------+ -| synchronize_device | To synchronize the desginated device | Y | +| synchronize_device | To synchronize the designated device | Y | +---------------------------+----------------------------------------------------------+----------+ | get_device_count | To count available devices | Y | +---------------------------+----------------------------------------------------------+----------+ diff --git a/docs/dev_guides/style_guide_and_references/error_message_writing_specification_cn.md b/docs/dev_guides/style_guide_and_references/error_message_writing_specification_cn.md index ba0ca92ce2a..3f4935b2dd1 100644 --- a/docs/dev_guides/style_guide_and_references/error_message_writing_specification_cn.md +++ b/docs/dev_guides/style_guide_and_references/error_message_writing_specification_cn.md @@ -266,7 +266,7 @@ PADDLE_ENFORCE_EQ( ```c++ PADDLE_ENFORCE( - tmp == *data_type || *data_type == dafault_data_type, + tmp == *data_type || *data_type == default_data_type, phi::errors::InvalidArgument( "The DataType of %s Op's duplicable Variable %s must be " "consistent. The current variable type is (%s), but the " diff --git a/docs/eval/evaluation_of_docs_system.md b/docs/eval/evaluation_of_docs_system.md index 7a909a32597..4dfaded535f 100644 --- a/docs/eval/evaluation_of_docs_system.md +++ b/docs/eval/evaluation_of_docs_system.md @@ -549,7 +549,7 @@ MindSpore 的有自己独立的文档分类标准和风格,所以硬套本文 | 数据加载与预处理 | Images CSV Numpy pandas.DataFrame TFRecord and tf.Example Additional formats with tf.io Text More text loading Classifying structured data with preprocessing layers Classfication on imbalanced data Time series forecasting Decision forest models | 13 | Datasets & Dataloaders | 1 | 数据处理 数据处理(进阶) 自动数据增强 轻量化数据处理 单节点数据缓存 优化数据处理 | 6 | 数据集的定义和加载 数据预处理 | 2 | | 如何组网 | Modules, layers, and models | 1 | Build the Neural Network Building Models with PyTorch What is torch.nn really? Learing PyTorch with Examples | 4 | 创建网络 网络构建 | 2 | 模型组网 飞桨高层 API 使用指南 层与模型 | 3 | | 如何训练 | Training loops NumPy API Checkpoint SavedModel | 4 | Optimization Model Parameters Traning wiht PyTorch | 2 | 模型训练 训练与评估 | 2 | 训练与预测验证 自定义指标 | 2 | -| 保存与加载模型 | Save and load Save and load(Distrbuted Training) | 2 | Save and Load the Model | 1 | 保存与加载 | 1 | 模型保存与载入 模型保存及加载(应用实践) | 2 | +| 保存与加载模型 | Save and load Save and load(Distributed Training) | 2 | Save and Load the Model | 1 | 保存与加载 | 1 | 模型保存与载入 模型保存及加载(应用实践) | 2 | | 可视化、调优技巧 | Overfit and underfit Tune hyperprameters with Keras Tuner Better performance with tf.function Profile TensorFlow performance Graph optimizaition Optimize GPU Performance Mixed precision | 7 | PyTorch TensorBoard Support Model Understanding with Captum Visualizing Models, Data, and Training with TensorBoard Profiling your PyTorch Module PyTorch Profiler with TensorBoard Hyperparameter tuning with Ray Tune Optimizing Vision Transformer Model for Deployment Parametrization Tutorial Pruning Tutorial Grokking PyTorch Intel CPU performance from first principles | 11 | 查看中间文件 Dump 功能调试 自定义调试信息 调用自定义类 算子增量编译 算子调优工具 自动数据加速 固定随机性以复现脚本运行结果 | 8 | VisualDL 工具简介 VisualDL 使用指南 飞桨模型量化 | 3 | | 自动微分 | Automatic differentiation Advanced autodiff | 2 | Automatic Differentiation with torch.autograd The Fundamentals of Autograd | 2 | 自动微分 | 1 | 自动微分 | 1 | | 动态图与静态图 | Graphs and functions | 1 | (torchscript 其实是静态图,不过归类到部署中了) | 0 | 动态图与静态图 | 1 | 使用样例 转换原理 支持语法 案例解析 报错调试 动态图 使用动转静完成以图搜图 | 7 | diff --git a/docs/guides/06_distributed_training/data_parallel/amp_cn.rst b/docs/guides/06_distributed_training/data_parallel/amp_cn.rst index ccf59c196d8..b41510ab9f0 100644 --- a/docs/guides/06_distributed_training/data_parallel/amp_cn.rst +++ b/docs/guides/06_distributed_training/data_parallel/amp_cn.rst @@ -126,8 +126,8 @@ start_timer() # 获取训练开始时间 for epoch in range(epochs): - datas = zip(train_data, labels) - for i, (data, label) in enumerate(datas): + data = zip(train_data, labels) + for i, (data, label) in enumerate(data): output = model(data) loss = mse(output, label) @@ -177,8 +177,8 @@ start_timer() # 获取训练开始时间 for epoch in range(epochs): - datas = zip(train_data, labels) - for i, (data, label) in enumerate(datas): + data = zip(train_data, labels) + for i, (data, label) in enumerate(data): # Step2:创建 AMP 上下文环境,开启自动混合精度训练 with paddle.amp.auto_cast(): diff --git a/docs/guides/beginner/tensor_en.md b/docs/guides/beginner/tensor_en.md index f894a55a191..cebe9f02790 100644 --- a/docs/guides/beginner/tensor_en.md +++ b/docs/guides/beginner/tensor_en.md @@ -514,7 +514,7 @@ Note that no copies happened while broadcasting. In PaddlePaddle, tensors are broadcastable when following rulrs hold(ref [Numpy Broadcasting](https://numpy.org/doc/stable/user/basics.broadcasting.html#module-numpy.doc.broadcasting)): -1. there should be at least one dimention in each tensor +1. there should be at least one dimension in each tensor 2. when comparing their shapes element-wise from backward to forward, two dimensions are compatible when they are equal, or one of them is 1, or one of them does not exist. @@ -532,10 +532,10 @@ x = paddle.ones((2, 3, 1, 5)) y = paddle.ones((3, 4, 1)) # compare from backward to forward: -# 1st step:y's dimention is 1 -# 2nd step:x's dimention is 1 -# 3rd step:two dimentions are the same -# 4st step:y's dimention does not exist +# 1st step:y's dimension is 1 +# 2nd step:x's dimension is 1 +# 3rd step:two dimensions are the same +# 4st step:y's dimension does not exist # So, x and y are broadcastable z = x + y print(z.shape) @@ -544,7 +544,7 @@ print(z.shape) # In Compare x = paddle.ones((2, 3, 4)) y = paddle.ones((2, 3, 6)) -# x and y are not broadcastable because in first step form tail, x's dimention 4 is not equal to y's dimention 6 +# x and y are not broadcastable because in first step form tail, x's dimension 4 is not equal to y's dimension 6 # z = x, y # ValueError: (InvalidArgument) Broadcast dimension mismatch. ``` diff --git a/docs/guides/beginner/tensor_index_cn.md b/docs/guides/beginner/tensor_index_cn.md index 7dd85112c78..35dcfef1c11 100644 --- a/docs/guides/beginner/tensor_index_cn.md +++ b/docs/guides/beginner/tensor_index_cn.md @@ -354,7 +354,7 @@ Tensor(shape=[1, 2, 3, 4], dtype=int64, place=Place(cpu), stop_gradient=True, [16, 17, 18, 19], [20, 21, 22, 23]]]]) ->>> b = a[:, [0,0,1], [1,2,0],:] # the new dimention is at axis 1 +>>> b = a[:, [0,0,1], [1,2,0],:] # the new dimension is at axis 1 >>> b Tensor(shape=[1, 3, 4], dtype=int64, place=Place(cpu), stop_gradient=True, [[[4 , 5 , 6 , 7 ], @@ -369,7 +369,7 @@ Tensor(shape=[1, 3], dtype=int64, place=Place(cpu), stop_gradient=True, #### 场景 2-高级索引位置不相邻 当高级索引位置不相邻时,则`index`对应产生最终的输出结果会放到第一维上。 ```python ->>> d = a[:, [1], :, [2,1,0]] # advanced indexes are not adjacent, the new dimention is at axis 0 +>>> d = a[:, [1], :, [2,1,0]] # advanced indexes are not adjacent, the new dimension is at axis 0 >>> d Tensor(shape=[3, 1, 3], dtype=int64, place=Place(cpu), stop_gradient=True, [[[14, 18, 22]], diff --git a/docs/guides/flags/memory_en.rst b/docs/guides/flags/memory_en.rst index 74ad5a3910c..8c348eec57d 100644 --- a/docs/guides/flags/memory_en.rst +++ b/docs/guides/flags/memory_en.rst @@ -205,7 +205,7 @@ FLAGS_initial_gpu_memory_in_mb=4096 will allocate 4 GB as initial GPU chunk. Note ------- If you set this flag, the memory size set by FLAGS_fraction_of_gpu_memory_to_use will be overrided by this flag, PaddlePaddle will allocate the initial gpu memory with size specified by this flag. -If you don't set this flag, the dafault value 0 will disable this GPU memory strategy. PaddlePaddle will use FLAGS_fraction_of_gpu_memory_to_use to allocate the initial GPU chunk. +If you don't set this flag, the default value 0 will disable this GPU memory strategy. PaddlePaddle will use FLAGS_fraction_of_gpu_memory_to_use to allocate the initial GPU chunk. @@ -246,7 +246,7 @@ FLAGS_reallocate_gpu_memory_in_mb=1024 will re-allocate 1 GB if run out of GPU m Note ------- If this flag is set, the memory size set by FLAGS_fraction_of_gpu_memory_to_use will be overrided by this flag, PaddlePaddle will re-allocate the gpu memory with size specified by this flag. -If you don't set this flag, the dafault value 0 will disable this GPU memory strategy. PaddlePaddle will use FLAGS_fraction_of_gpu_memory_to_use to re-allocate GPU memory. +If you don't set this flag, the default value 0 will disable this GPU memory strategy. PaddlePaddle will use FLAGS_fraction_of_gpu_memory_to_use to re-allocate GPU memory. FLAGS_use_pinned_memory diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.utils.data.BatchSampler.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.utils.data.BatchSampler.md index 8c5f7db119c..14c51ff7b01 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.utils.data.BatchSampler.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.utils.data.BatchSampler.md @@ -10,7 +10,7 @@ torch.utils.data.BatchSampler(sampler, ```python paddle.io.BatchSampler(dataset=None, sampler=None, - shuffle=Fasle, + shuffle=False, batch_size=1, drop_last=False) ``` diff --git a/docs/guides/paddle_v3_features/sot_cn.md b/docs/guides/paddle_v3_features/sot_cn.md index 94abb970c86..11e17e2ace0 100644 --- a/docs/guides/paddle_v3_features/sot_cn.md +++ b/docs/guides/paddle_v3_features/sot_cn.md @@ -130,7 +130,7 @@ import paddle import numpy as np import random -# set seed for determinated output +# set seed for determined output paddle.seed(2025) np.random.seed(2025) random.seed(2025) @@ -172,7 +172,7 @@ import paddle import numpy as np import random -# set seed for determinated output +# set seed for determined output paddle.seed(2025) np.random.seed(2025) random.seed(2025) diff --git a/docs/install/Tables_en.md b/docs/install/Tables_en.md index 9a3365f1808..7722f57a812 100644 --- a/docs/install/Tables_en.md +++ b/docs/install/Tables_en.md @@ -277,7 +277,7 @@ PaddePaddle implements references to various BLAS/CUDA/cuDNN libraries by specif Version Number - Release Discription + Release Description diff --git a/docs/practices/cv/pointnet.ipynb b/docs/practices/cv/pointnet.ipynb index 1ca01280b71..8b888ed875a 100755 --- a/docs/practices/cv/pointnet.ipynb +++ b/docs/practices/cv/pointnet.ipynb @@ -129,28 +129,28 @@ "outputs": [], "source": [ "def make_data(mode=\"train\", path=\"./dataset/\", num_point=2048):\n", - " datas = []\n", + " data = []\n", " labels = []\n", " if mode == \"train\":\n", " for file_list in train_list:\n", " f = h5py.File(os.path.join(path, file_list), \"r\")\n", - " datas.extend(f[\"data\"][:, :num_point, :])\n", + " data.extend(f[\"data\"][:, :num_point, :])\n", " labels.extend(f[\"label\"])\n", " f.close()\n", " elif mode == \"test\":\n", " for file_list in test_list:\n", " f = h5py.File(os.path.join(path, file_list), \"r\")\n", - " datas.extend(f[\"data\"][:, :num_point, :])\n", + " data.extend(f[\"data\"][:, :num_point, :])\n", " labels.extend(f[\"label\"])\n", " f.close()\n", " else:\n", " for file_list in val_list:\n", " f = h5py.File(os.path.join(path, file_list), \"r\")\n", - " datas.extend(f[\"data\"][:, :num_point, :])\n", + " data.extend(f[\"data\"][:, :num_point, :])\n", " labels.extend(f[\"label\"])\n", " f.close()\n", "\n", - " return datas, labels" + " return data, labels" ] }, { @@ -171,18 +171,18 @@ "outputs": [], "source": [ "class PointDataset(paddle.io.Dataset):\n", - " def __init__(self, datas, labels):\n", + " def __init__(self, data, labels):\n", " super().__init__()\n", - " self.datas = datas\n", + " self.data = data\n", " self.labels = labels\n", "\n", " def __getitem__(self, index):\n", - " data = paddle.to_tensor(self.datas[index].T.astype(\"float32\"))\n", + " data = paddle.to_tensor(self.data[index].T.astype(\"float32\"))\n", " label = paddle.to_tensor(self.labels[index].astype(\"int64\"))\n", " return data, label\n", "\n", " def __len__(self):\n", - " return len(self.datas)" + " return len(self.data)" ] }, { @@ -203,12 +203,12 @@ "outputs": [], "source": [ "# 数据导入\n", - "datas, labels = make_data(mode=\"train\", num_point=2048)\n", - "train_dataset = PointDataset(datas, labels)\n", - "datas, labels = make_data(mode=\"val\", num_point=2048)\n", - "val_dataset = PointDataset(datas, labels)\n", - "datas, labels = make_data(mode=\"test\", num_point=2048)\n", - "test_dataset = PointDataset(datas, labels)\n", + "data, labels = make_data(mode=\"train\", num_point=2048)\n", + "train_dataset = PointDataset(data, labels)\n", + "data, labels = make_data(mode=\"val\", num_point=2048)\n", + "val_dataset = PointDataset(data, labels)\n", + "data, labels = make_data(mode=\"test\", num_point=2048)\n", + "test_dataset = PointDataset(data, labels)\n", "\n", "# 实例化数据读取器\n", "train_loader = paddle.io.DataLoader(\n", diff --git a/docs/practices/gan/Pix2Pix/Pix2Pix_with_Cityscapes.ipynb b/docs/practices/gan/Pix2Pix/Pix2Pix_with_Cityscapes.ipynb index 7dea8231cb3..d3ac63dadb4 100644 --- a/docs/practices/gan/Pix2Pix/Pix2Pix_with_Cityscapes.ipynb +++ b/docs/practices/gan/Pix2Pix/Pix2Pix_with_Cityscapes.ipynb @@ -197,9 +197,9 @@ "import os\n", "\n", "\n", - "class MyDateset(paddle.io.Dataset):\n", + "class MyDataset(paddle.io.Dataset):\n", " def __init__(self, root_dir=\"cityscapes\", txt_dir=\"cityscapes/train.list\"):\n", - " super(MyDateset, self).__init__()\n", + " super(MyDataset, self).__init__()\n", "\n", " self.root_dir = root_dir\n", " with open(txt_dir, \"r\") as f:\n", @@ -229,7 +229,7 @@ "\n", "\n", "if 1:\n", - " dataset = MyDateset()\n", + " dataset = MyDataset()\n", "\n", " dataloader = paddle.io.DataLoader(\n", " dataset, batch_size=16, shuffle=True, drop_last=False\n", diff --git a/docs/practices/gan/cyclegan/cyclegan.ipynb b/docs/practices/gan/cyclegan/cyclegan.ipynb index 3a41ff744f3..56e1a4f0585 100644 --- a/docs/practices/gan/cyclegan/cyclegan.ipynb +++ b/docs/practices/gan/cyclegan/cyclegan.ipynb @@ -121,7 +121,7 @@ "\r\n", "\r\n", "# 定义horse2zebra数据集对象\r\n", - "class H2ZDateset(Dataset):\r\n", + "class H2ZDataset(Dataset):\r\n", " def __init__(self, data_dir):\r\n", " super().__init__()\r\n", " self.data_dir = data_dir\r\n", @@ -149,7 +149,7 @@ "\r\n", "\r\n", "# 定义图片loader\r\n", - "h2zdateset = H2ZDateset(DATA_DIR)\r\n", + "h2zdateset = H2ZDataset(DATA_DIR)\r\n", "loader = DataLoader(\r\n", " h2zdateset,\r\n", " shuffle=True,\r\n", @@ -803,7 +803,7 @@ " d_b = Disc()\r\n", "\r\n", " # 定义数据读取器\r\n", - " dataset = H2ZDateset(DATA_DIR)\r\n", + " dataset = H2ZDataset(DATA_DIR)\r\n", " reader_ab = DataLoader(\r\n", " dataset,\r\n", " shuffle=True,\r\n", diff --git a/docs/practices/nlp/addition_rnn.ipynb b/docs/practices/nlp/addition_rnn.ipynb index 90a7f398ba7..2bcf349ef37 100755 --- a/docs/practices/nlp/addition_rnn.ipynb +++ b/docs/practices/nlp/addition_rnn.ipynb @@ -76,7 +76,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "generating datas..\n", + "generating data..\n", "making the dataset...\n", "finish\n" ] @@ -102,9 +102,9 @@ "\n", "\n", "# 批量数据生成函数\n", - "def gen_datas(DATA_NUM, MAX_NUM, DIGITS, label_dict):\n", - " datas = []\n", - " while len(datas) < DATA_NUM:\n", + "def gen_data(DATA_NUM, MAX_NUM, DIGITS, label_dict):\n", + " data = []\n", + " while len(data) < DATA_NUM:\n", " # 随机取两个数\n", " a = random.randint(0, MAX_NUM)\n", " b = random.randint(0, MAX_NUM)\n", @@ -117,28 +117,28 @@ " np.array(_).astype(\"int64\")\n", " for _ in make_data(inputs, labels, DIGITS, label_dict)\n", " ]\n", - " datas.append([inputs, labels])\n", - " return datas\n", + " data.append([inputs, labels])\n", + " return data\n", "\n", "\n", "# 继承paddle.io.Dataset来构造数据集\n", "class Addition_Dataset(paddle.io.Dataset):\n", " # 重写数据集初始化函数\n", - " def __init__(self, datas):\n", + " def __init__(self, data):\n", " super().__init__()\n", - " self.datas = datas\n", + " self.data = data\n", "\n", " # 重写生成样本的函数\n", " def __getitem__(self, index):\n", - " data, label = [paddle.to_tensor(_) for _ in self.datas[index]]\n", + " data, label = [paddle.to_tensor(_) for _ in self.data[index]]\n", " return data, label\n", "\n", " # 重写返回数据集大小的函数\n", " def __len__(self):\n", - " return len(self.datas)\n", + " return len(self.data)\n", "\n", "\n", - "print(\"generating datas..\")\n", + "print(\"generating data..\")\n", "\n", "# 定义字符表\n", "label_dict = {\n", @@ -174,12 +174,12 @@ "MAX_NUM = 10 ** (DIGITS) - 1\n", "\n", "# 生成数据\n", - "train_datas = gen_datas(train_num, MAX_NUM, DIGITS, label_dict)\n", - "dev_datas = gen_datas(dev_num, MAX_NUM, DIGITS, label_dict)\n", + "train_data = gen_data(train_num, MAX_NUM, DIGITS, label_dict)\n", + "dev_data = gen_data(dev_num, MAX_NUM, DIGITS, label_dict)\n", "\n", "# 实例化数据集\n", - "train_dataset = Addition_Dataset(train_datas)\n", - "dev_dataset = Addition_Dataset(dev_datas)\n", + "train_dataset = Addition_Dataset(train_data)\n", + "dev_dataset = Addition_Dataset(dev_data)\n", "\n", "print(\"making the dataset...\")\n", "\n", diff --git a/docs/practices/nlp/transformer_in_English-to-Spanish.ipynb b/docs/practices/nlp/transformer_in_English-to-Spanish.ipynb index 6a44992e642..0fd7b48a958 100644 --- a/docs/practices/nlp/transformer_in_English-to-Spanish.ipynb +++ b/docs/practices/nlp/transformer_in_English-to-Spanish.ipynb @@ -384,7 +384,7 @@ }, "outputs": [], "source": [ - "def pre_process(datas, save_punctuation=False):\n", + "def pre_process(data, save_punctuation=False):\n", " dataset = []\n", " # 定义标点符号集合\n", "\n", @@ -392,8 +392,8 @@ " strip_chars = strip_chars.replace(\"[\", \"\")\n", " strip_chars = strip_chars.replace(\"]\", \"\")\n", "\n", - " for i in range(len(datas)):\n", - " lowercase = datas[i].lower() # 全部转为小写\n", + " for i in range(len(data)):\n", + " lowercase = data[i].lower() # 全部转为小写\n", "\n", " out = \"\"\n", " if save_punctuation:\n", @@ -1424,8 +1424,8 @@ " encoder_outputs = self.encoder(encoder_emb)\n", "\n", " # 解码器\n", - " deocder_emb = self.ps2(decoder_inputs)\n", - " decoder_outputs = self.decoder(deocder_emb, encoder_outputs)\n", + " decoder_emb = self.ps2(decoder_inputs)\n", + " decoder_outputs = self.decoder(decoder_emb, encoder_outputs)\n", "\n", " # dropout\n", " out = self.drop(decoder_outputs)\n", diff --git a/docs/practices/time_series/autoencoder.ipynb b/docs/practices/time_series/autoencoder.ipynb index 1fa79f7ad94..9e1a19847a7 100755 --- a/docs/practices/time_series/autoencoder.ipynb +++ b/docs/practices/time_series/autoencoder.ipynb @@ -550,7 +550,7 @@ "model.load_dict(param_dict) # 加载参数\n", "model.eval() # 预测\n", "total_loss = []\n", - "datas = []\n", + "data = []\n", "# 预测所有正常时序\n", "mse_loss = paddle.nn.loss.MSELoss()\n", "# 这里设置batch_size为1,单独求得每个数据的loss\n", @@ -568,9 +568,9 @@ " out = model(x)\n", " avg_loss = mse_loss(out, (y[:, :, :-1]))\n", " total_loss.append(avg_loss.numpy()[0])\n", - " datas.append(batch_id)\n", + " data.append(batch_id)\n", "\n", - "plt.bar(datas, total_loss)\n", + "plt.bar(data, total_loss)\n", "plt.ylabel(\"reconstruction loss\")\n", "plt.xlabel(\"data samples\")\n", "plt.show()\n",