diff --git a/chapter_programming_interface/c_python_interaction.md b/chapter_programming_interface/c_python_interaction.md index 6831a41..a1156fe 100644 --- a/chapter_programming_interface/c_python_interaction.md +++ b/chapter_programming_interface/c_python_interaction.md @@ -9,7 +9,7 @@ Binding)。在Pybind11出现以前,将C和C++函数进行Python绑定的手 - Python的C-API。这种方式要求在一个C++程序中包含Python.h,并使用Python的C-API对Python语言进行操作。使用这套API需要对Python的底层实现有一定了解,比如如何管理引用计数等,具有较高的使用门槛。 -- 简单包装界面产生器(Simplified Wrapper and Interface Generator,SWIG)。SWIG可以将C和C++代码暴露给Python。SWIG是TensorFlow早期使用的方式。这种方式需要用户便携一个复杂的SWIG接口声明文件,并使用SWIG自动生成使用Python +- 简单包装界面产生器(Simplified Wrapper and Interface Generator,SWIG)。SWIG可以将C和C++代码暴露给Python。SWIG是TensorFlow早期使用的方式。这种方式需要用户编写一个复杂的SWIG接口声明文件,并使用SWIG自动生成使用Python C-API的C代码。自动生成的代码可读性很低,因此具有很大代码维护开销。 - Python的ctypes模块,提供了C语言中的类型,以及直接调用动态链接库的能力。缺点是依赖于C的原生的类型,对自定义类型支持不好。 diff --git a/chapter_programming_interface/neural_network_layer.md b/chapter_programming_interface/neural_network_layer.md index d454da5..f1a2c41 100644 --- a/chapter_programming_interface/neural_network_layer.md +++ b/chapter_programming_interface/neural_network_layer.md @@ -98,7 +98,7 @@ Transformer又是BERT模型架构的重要组成。随着深度神经网络的 随着网络层数的增加,手动管理训练变量是一个繁琐的过程,因此2.3.1中描述的接口在机器学习库中属于低级API。 机器学习编程库大都提供了更高级用户友好的API,它将神经网络层抽象成一个基类,所有的神经网络层实现都继承基类调用低级API。 如MindSpore提供的mindspore.nn.Cell、mindspore.nn.Conv2d、mindspore.dataset; -PyTorch提供的torch.nn.Module、torch.nn.Conv2d、torch.utils.data.Datset。 +PyTorch提供的torch.nn.Module、torch.nn.Conv2d、torch.utils.data.Dataset。 :numref:`model_build`描述了神经网络构建过程中的基本细节。 神经网络层需要的功能有该层的训练参数(变量,包括初始化方法和训练状态)以及计算过程; diff --git a/info/editors.md b/info/editors.md index 7221fd2..8005dc6 100644 --- a/info/editors.md +++ b/info/editors.md @@ -6,7 +6,7 @@ 第1章 - 导论:[@luomai](https://github.com/luomai) -第2章 - 编程模型:[@Laicheng0830](https://github.com/Laicheng0830) +第2章 - 编程接口:[@Laicheng0830](https://github.com/Laicheng0830) 第3章 - 计算图:[@hanjr92](https://github.com/hanjr92)