我正在尝试理解以及如何解释 keras 模型的 JSON 表示形式。每个层的输入都保存在 inbound_nodes
字段中。我不明白的是它们是数组。
例如,对于合并层的 2 个输入,它看起来像这样:
inbound_nodes: [
[
['average_pooling2d_1', 0, 0, {}],
['conv2d_3', 0, 0, {}],
]
]
所有数组怎么了?为什么不这样保存:
inbound_nodes: ['average_pooling2d_1', 'conv2d_3']
我猜这个结构是因为有时必须以某种方式保存额外的信息。那是什么信息?例如。 inbound_nodes 的大小何时大于 1?
最佳答案
'pooling2d'后面的参数可能是为 future 的特性设计的。当层有其他数据流时,inbound_nodes的大小>1。更多细节,查看节点和层的定义keras source code
关于json - Keras JSON 导出 : inbound_nodes,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45794583/