Home > database >  How does Keras layout works in Tensorflow
How does Keras layout works in Tensorflow

Time:02-18

I'm testing Tensorflow but I can't figure out how the models are structered. For example, in the official documentation there are the following indications :

A Sequential model is appropriate for a plain stack of layers where each layer has exactly one input tensor and one output tensor.

...

A Sequential model is not appropriate when:

 - Your model has multiple inputs or multiple outputs
 - Any of your layers has multiple inputs or multiple outputs
 - You need to do layer sharing
 - You want non-linear topology (e.g. a residual connection, a multi-branch model)

Does this mean that the model only accepts 1 value type of data as Input/Output or just only 1 value as Input/Output?

What I want to do, is use two hexadecimals values predict a third hexadecimal value, for this i have the dataset structured in bits e.g:

hex0[0], hex0[1],.... hex0[n], hex1[0], hex1[1], ... hex1[n], result[0], result[1]... result[n]
0       ,1      ,..., 1      , 1      , 9      , ...,1      , 1        , 1       ,... , 0  

The keras.Sequential model works for this type of problem?

CodePudding user response:

It means that it accepts only one type of data (all values numeric or all categorical) because in Sequential model all input values go thru all layers sequentialy.

I prefere documentation in keras.io https://keras.io/api/models/sequential/#sequential-class

In your case all input data are the same type so You can use sequential model.

input is: [hex0[0], hex1[0]

output result[0]

The shape of input and output array is very important.

  • Related