简体   繁体   English

Python 中的包装器是什么?

[英]What is a wrapper in Python?

I am currently in the process of learning Keras, a Deep Learning module.我目前正在学习深度学习模块 Keras。

I came across a sentence that I can't understand because I don't know what a python Wrapper is.我遇到了一个我无法理解的句子,因为我不知道 python Wrapper 是什么。

from keras.models import Sequential

#Create the Sequential model
model = Sequential() 

"The keras.models.Sequential class is a wrapper for the neural network model that treats the network as a sequence of layers. It implements the Keras model interface with common methods like compile(), fit(), and evaluate() that are used to train and run the model." "The keras.models.Sequential class is a wrapper for the neural network model that treats the network as a sequence of layers. It implements the Keras model interface with common methods like compile(), fit(), and evaluate() that are用于训练和运行 model。”

In the above sentence, what is a Python wrapper and what does it do?在上面的句子中,什么是 Python 包装器,它有什么作用?

This is not unique to Python.这不是 Python 独有的。 In this case, Sequential is a helper class that provides methods to make the creation of this specific type of neural network model easier.在这种情况下, Sequential是一个助手 class,它提供了使创建这种特定类型的神经网络 model 更容易的方法。 It inherits many properties from its parent class, which is a generic Model .它从其父 class 继承了许多属性,这是一个通用的Model See the source for more info.有关更多信息,请参阅来源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM