{
  "id": 210400,
  "title": "Functional vs Sequential API? Tensorflow",
  "url": "/competitions/cassava-leaf-disease-classification/discussion/210400",
  "author_name": "Yuri Njathi",
  "post_date": "2021-01-10T16:33:52.081000",
  "votes": -3,
  "comment_count": 0,
  "views": 0,
  "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3592731%2F0becf598e3720f0e1bf615151ce0114e%2FCNN%20architecture.png?generation=1610296827352672&amp;alt=media\" alt=\"image\"></p>\n<h4>Functional API</h4>\n<p>Ever seen a model like the one above and wondered how do I implement that?<br>\nWell luckily the functional API exists.</p>\n<p>The functional API allows you to create models that have a lot more flexibility as you can easily define models where layers connect to more than just the previous and next layers. In fact, you can connect layers to (literally) any other layer. As a result, creating complex networks such as siamese networks and residual networks become possible.</p>\n<h4>Sequential API</h4>\n<p>This is the api that is more commonly used with tensorflow but its not the best for building complex models or ensembles.<br>\nThe sequential API allows you to create models layer-by-layer for most problems. It is limited in that it does not allow you to create models that share layers or have multiple inputs or outputs.</p>\n<p><a href=\"https://www.tensorflow.org/guide/keras/functional#extract_and_reuse_nodes_in_the_graph_of_layers\" target=\"_blank\">TensorFlow Functional API</a></p>\n<p>Good Reads : <br>\n<a href=\"https://machinelearningmastery.com/how-to-use-transfer-learning-when-developing-convolutional-neural-network-models/\" target=\"_blank\">Transfer Learning in Keras with Computer Vision Models</a></p>",
  "messages": [
    {
      "id": 1147674,
      "postDate": "2021-01-10T16:33:52.080Z",
      "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3592731%2F0becf598e3720f0e1bf615151ce0114e%2FCNN%20architecture.png?generation=1610296827352672&amp;alt=media\" alt=\"image\"></p>\n<h4>Functional API</h4>\n<p>Ever seen a model like the one above and wondered how do I implement that?<br>\nWell luckily the functional API exists.</p>\n<p>The functional API allows you to create models that have a lot more flexibility as you can easily define models where layers connect to more than just the previous and next layers. In fact, you can connect layers to (literally) any other layer. As a result, creating complex networks such as siamese networks and residual networks become possible.</p>\n<h4>Sequential API</h4>\n<p>This is the api that is more commonly used with tensorflow but its not the best for building complex models or ensembles.<br>\nThe sequential API allows you to create models layer-by-layer for most problems. It is limited in that it does not allow you to create models that share layers or have multiple inputs or outputs.</p>\n<p><a href=\"https://www.tensorflow.org/guide/keras/functional#extract_and_reuse_nodes_in_the_graph_of_layers\" target=\"_blank\">TensorFlow Functional API</a></p>\n<p>Good Reads : <br>\n<a href=\"https://machinelearningmastery.com/how-to-use-transfer-learning-when-developing-convolutional-neural-network-models/\" target=\"_blank\">Transfer Learning in Keras with Computer Vision Models</a></p>",
      "rawMarkdown": "![image](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3592731%2F0becf598e3720f0e1bf615151ce0114e%2FCNN%20architecture.png?generation=1610296827352672&alt=media)\n\n\n\n#### Functional API\nEver seen a model like the one above and wondered how do I implement that?\nWell luckily the functional API exists.\n\nThe functional API allows you to create models that have a lot more flexibility as you can easily define models where layers connect to more than just the previous and next layers. In fact, you can connect layers to (literally) any other layer. As a result, creating complex networks such as siamese networks and residual networks become possible.\n\n#### Sequential API\nThis is the api that is more commonly used with tensorflow but its not the best for building complex models or ensembles.\nThe sequential API allows you to create models layer-by-layer for most problems. It is limited in that it does not allow you to create models that share layers or have multiple inputs or outputs.\n\n\n[TensorFlow Functional API](https://www.tensorflow.org/guide/keras/functional#extract_and_reuse_nodes_in_the_graph_of_layers)\n\nGood Reads : \n[Transfer Learning in Keras with Computer Vision Models](https://machinelearningmastery.com/how-to-use-transfer-learning-when-developing-convolutional-neural-network-models/)",
      "votes": -3
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "1147674": "![image](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3592731%2F0becf598e3720f0e1bf615151ce0114e%2FCNN%20architecture.png?generation=1610296827352672&alt=media)\n\n\n\n#### Functional API\nEver seen a model like the one above and wondered how do I implement that?\nWell luckily the functional API exists.\n\nThe functional API allows you to create models that have a lot more flexibility as you can easily define models where layers connect to more than just the previous and next layers. In fact, you can connect layers to (literally) any other layer. As a result, creating complex networks such as siamese networks and residual networks become possible.\n\n#### Sequential API\nThis is the api that is more commonly used with tensorflow but its not the best for building complex models or ensembles.\nThe sequential API allows you to create models layer-by-layer for most problems. It is limited in that it does not allow you to create models that share layers or have multiple inputs or outputs.\n\n\n[TensorFlow Functional API](https://www.tensorflow.org/guide/keras/functional#extract_and_reuse_nodes_in_the_graph_of_layers)\n\nGood Reads : \n[Transfer Learning in Keras with Computer Vision Models](https://machinelearningmastery.com/how-to-use-transfer-learning-when-developing-convolutional-neural-network-models/)"
  }
}