About Me

My photo
Hi! I am Rahul. After years of bouncing around different sectors, I've been specializing in Python, Machine Learning, Deep Learning, NLP, and Statistics. Being a Technology Lover, I strongly believe 'Nothing can stress or stop you from achieving your dreams if you cherish hope more than your fears.'

Sunday, April 11, 2021

Advantages & Disadvantages of Sequential and Functional APIs

Both Sequential APIs and Functional APIs are declarative

It means you start it by declaring which layers you want to use and how they should be connected, and only then can you start feeding the model some data for training or inference.

So advantages of having this:

  1. The model can easily be saved, cloned, and shared.
  2. Its structure can be displayed and analyzed.
  3. The framework can infer shapes and check types, so errors can be caught easily (i.e. before any data ever goes through the model).
  4. It's also fairly easy to debug since the whole model is a static graph of layers.
But the flip side is just that: it's static. 
Some models involve loops, varying shapes, conditional branches, and other dynamic behavior. 

For such cases, the Subclassing API is for you.

Source: Hands-On Machine Learning with Scikit-Learn, Keras & TensorFlow

No comments:

Problems with Sigmoid and Tanh activation functions

The Sigmoid activation function is also known as the Logistic function . The input to the function is transformed into a value between 0 an...