What is meant by sequential model?
Sequential model
hey @nikhil_sarda ,
Keras provides two ways to create neural network model.
Sequential API and Functional Model API.
Sequential Mean stacking layers in linear manner, one after the other.
Both perform the same task , just the difference in is the way you implement them.
Sequential API requires adding layers in a sequential order , the way you need them.
for example :
model = sequential()
model.add(Dense(32,input_shape =(12,)))
model.add(Dense(8))
model.add(Dense(1))
like this .
The same thing will be done using Model API like
input = Input(shape=(12,))
output = Dense(32)(input)
output = Dense(8)(output)
output = Dense(1)(output)
model = Model(input,output)
Both will prepare the same model.
Sequential api model is used in ways when you have only one input and one output.
When dealing with multiple inputs , we go for Model API.
I hope this would have helped you.
Thank You.
I didn’t get the last part, we are having multiple inputs but still using sequential?
multiple inputs means like creating a model which accepts two images as input to process .
As the name suggests , Sequential model requires layers to be stacked in a sequential manner , just like a pile of plates , and hence if you think , you have place two plates at the same level of a pile Which is not possible. Similarly , providing two inputs simultaneously to sequential model is also not provided.
can you share your code link , to show this thing.
Thank You.
Like that in the covid-19 project video , sir used sequential and we had a batch of 32 and 100s of images which we used generator to put through the model.
See , that is training your model over batches , for batch gradient descent. It is still providing a single image at once .
The above model image , is a representation of a model taking single input to process.
and
This is an example of multiple inputs .