Functional and sequential api

Is it possible to create some layers of CNN in sequential API and some in Functional API?? If can be then how to implement that in tensorflow??

Sure, you can chain together modules using both APIs. In the Sequential API, you just have a list of layers and it takes one input and produces (finally) one output. Then you can feed that output into a Functional API layer if you need a more complex graph than you can get with the Sequential API.

They don’t give us that much guidance about this in the notebooks or the lectures. If you want to know more, you need to study the tutorials on the TF website or have a look at this thread from fellow student ai_curious who has done a much better explanation of these two methods than what we see in the notebooks.

Now that you mention it, they actually gave us an example of how to do exactly this in the MobilNet Transfer Learning assignment. The overall alpaca_model is defined with the Functional API, but they call the data augmentation module, which is a Sequential API function, from the higher level model. Have a look for one example of how to do this.

1 Like

There’s another related recent thread here ==> Understanding the difference between Sequential / Functional model

It contains a link to a Keras guide that has some useful examples of building models with complex topology that might leverage both APIs.