网页
综合
更新时间 2026-11-15 00:14:32
Keras layers API
自动蜘蛛
keras.io
正文约 700 字
Layers are the basic building blocks of neural networks in Keras. A layer consists of a tensor-in tensor-out computation function (the layer's call method) and some state, held in TensorFlow variables (the layer's weights).
A Layer instance is callable, much like a function:
Unlike a function, though, layers maintain a state, updated when the layer receives data during training, and stored in layer.weights:
While Keras offers a wide range of built-in layers, they don't cover ever possible use case. Creating custom layers is very common, and very easy.
See the guide Making new layers and models via subclassing for an extensive overview, and refer to the documentation for the base Layer class.
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。