Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keras JSON export: inbound_nodes

I am trying to understand and how to interprate the JSON representation of a keras model. Each layer has it's inputs saved within the field inbound_nodes. What I don't understand are they arrays.

For example for 2 Inputs for a merge layer it looks like that:

inbound_nodes: [
  [
    ['average_pooling2d_1', 0, 0, {}],
    ['conv2d_3', 0, 0, {}],
  ]
]

Whats up with all the arrays? Why not save like that:

inbound_nodes: ['average_pooling2d_1', 'conv2d_3']

I guess the structure is because sometimes additional information must be saved somehow. What kind of information is that? E.g. when is the size of inbound_nodes > 1?

like image 649
Jodo Avatar asked Mar 25 '26 17:03

Jodo


1 Answers

The parameters behind 'pooling2d' may be designed for future features.The size of inbound_nodes>1 when layers have other data stream.For more details,check the definition of Node and Layer keras source code

like image 84
sasmac_skylight Avatar answered Mar 27 '26 08:03

sasmac_skylight



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!