{"id":53931,"date":"2025-09-25T10:39:01","date_gmt":"2025-09-25T00:39:01","guid":{"rendered":"https:\/\/www.cloudproinc.com.au\/?p=53931"},"modified":"2025-09-25T10:39:04","modified_gmt":"2025-09-25T00:39:04","slug":"keras-functional-api","status":"publish","type":"post","link":"https:\/\/cloudproinc.com.au\/index.php\/2025\/09\/25\/keras-functional-api\/","title":{"rendered":"Keras Functional API"},"content":{"rendered":"\n<p>In this blog post Keras Functional API Demystified for Flexible Deep Learning Workflows we will unpack what the Keras Functional API is, why it matters, and how to use it effectively in real projects.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>The Keras Functional API is the sweet spot between simplicity and power. It keeps the approachable feel of Keras while letting you build complex model topologies\u2014branching, merging, multi-input\/multi-output, and shared layers\u2014without dropping down to raw TensorFlow code. If you\u2019ve outgrown Sequential models but don\u2019t want the boilerplate of full subclassing, this is for you.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-s-happening-under-the-hood\">What\u2019s happening under the hood<\/h2>\n\n\n\n<p>Keras runs on top of TensorFlow, where data flows through a computational graph. In the Functional API, layers are callable objects. When you call a layer on a tensor, Keras doesn\u2019t just compute; it records a node in a directed acyclic graph (DAG). This graph tracks:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/18\/the-autonomy-of-tensors\/\">Tensor <\/a>shapes and dtypes<\/li>\n\n\n\n<li>Connections between layers (inputs and outputs)<\/li>\n\n\n\n<li>Names and metadata for inspection and saving<\/li>\n<\/ul>\n\n\n\n<p>Once you define inputs and outputs, Keras wraps the graph into a Model. TensorFlow handles automatic differentiation, device placement, and optimizations. You get concise model definitions that scale from simple MLPs to Siamese networks and multi-task models.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-when-to-choose-the-functional-api\">When to choose the Functional API<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You need branching or merging paths (e.g., residual blocks).<\/li>\n\n\n\n<li>You want multiple inputs or multiple outputs.<\/li>\n\n\n\n<li>You plan to share weights across different parts of a model (e.g., Siamese).<\/li>\n\n\n\n<li>You want clear, serializable architectures for deployment.<\/li>\n<\/ul>\n\n\n\n<p>If your model is a straight stack, Sequential is fine. If your model needs dynamic control flow dependent on data values at runtime, subclassing may be better. For most production-ready, inspectable architectures, Functional is ideal.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-build-your-first-functional-model\">Build your first Functional model<\/h2>\n\n\n\n<p>Start with Inputs, compose layers like functions, and finish by constructing a Model.<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-9b06ebdb97deff896092071597a7d5c0\"><code>import tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\n\n# 1) Define inputs\ninputs = keras.Input(shape=(32,), name=\"features\")\n\n# 2) Compose layers\nx = layers.Dense(64, activation=\"relu\", name=\"dense_1\")(inputs)\nx = layers.Dropout(0.2, name=\"dropout\")(x)\noutputs = layers.Dense(1, activation=\"sigmoid\", name=\"output\")(x)\n\n# 3) Build, compile, inspect\nmodel = keras.Model(inputs=inputs, outputs=outputs, name=\"simple_mlp\")\nmodel.compile(optimizer=\"adam\", loss=\"binary_crossentropy\", metrics=&#91;\"AUC\"]) \nmodel.summary()\n<\/code><\/pre>\n\n\n\n<p>This captures a clear graph: features \u2192 Dense \u2192 Dropout \u2192 output. The names help traceability in logs and model cards.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-branching-and-merging-paths\">Branching and merging paths<\/h2>\n\n\n\n<p>Branching is as simple as calling the same input tensor with different layers, then merging with Concatenate, Add, Average, or custom ops.<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-e919f50627d048d2f83131fbdf293400\"><code>inputs = keras.Input(shape=(128,), name=\"text_embed\")\n\nx_relu = layers.Dense(64, activation=\"relu\", name=\"relu_path\")(inputs)\nx_tanh = layers.Dense(64, activation=\"tanh\", name=\"tanh_path\")(inputs)\n\nmerged = layers.Concatenate(name=\"concat\")(&#91;x_relu, x_tanh])\noutputs = layers.Dense(3, activation=\"softmax\", name=\"class_probs\")(merged)\n\nmodel = keras.Model(inputs, outputs, name=\"branched_classifier\")\nmodel.compile(optimizer=\"adam\", loss=\"sparse_categorical_crossentropy\", metrics=&#91;\"accuracy\"]) \n<\/code><\/pre>\n\n\n\n<p>This pattern covers residual connections, multi-scale features, and ensembling within a single model graph.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-multiple-inputs-and-outputs\">Multiple inputs and outputs<\/h2>\n\n\n\n<p>Real systems often combine numeric features with text or images, and predict more than one target. The Functional API makes this natural.<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-0dbc6c325f09887c2cf645b12d5ea92a\"><code>num_in = keras.Input(shape=(10,), name=\"numeric\")\ntok_in = keras.Input(shape=(100,), dtype=\"int32\", name=\"tokens\")\n\nx_num = layers.BatchNormalization(name=\"bn_num\")(num_in)\n\nx_tok = layers.Embedding(input_dim=20000, output_dim=64, mask_zero=True, name=\"embed\")(tok_in)\nx_tok = layers.GlobalAveragePooling1D(name=\"pool_tokens\")(x_tok)\n\nx = layers.Concatenate(name=\"concat_features\")(&#91;x_num, x_tok])\n\nclass_out = layers.Dense(1, activation=\"sigmoid\", name=\"class\")(x)\nprice_out = layers.Dense(1, name=\"price\")(x)\n\nmodel = keras.Model(&#91;num_in, tok_in], &#91;class_out, price_out], name=\"multitask_model\")\nmodel.compile(\n    optimizer=\"adam\",\n    loss={\"class\": \"binary_crossentropy\", \"price\": \"mse\"},\n    metrics={\"class\": &#91;\"AUC\"], \"price\": &#91;\"mae\"]},\n)\n<\/code><\/pre>\n\n\n\n<p>Training accepts dictionaries or lists keyed by layer names. This clarity pays off in production where feature contracts evolve.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-weight-sharing-and-siamese-networks\">Weight sharing and Siamese networks<\/h2>\n\n\n\n<p>Use the same layer stack twice to learn comparable embeddings and a distance-based decision.<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-bcf17a8b74cc2d073e590b74df486dcc\"><code>import tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\n\ninp_a = keras.Input(shape=(28, 28, 1), name=\"img_a\")\ninp_b = keras.Input(shape=(28, 28, 1), name=\"img_b\")\n\nbase = keras.Sequential(&#91;\n    layers.Conv2D(32, 3, activation=\"relu\"),\n    layers.MaxPooling2D(),\n    layers.Conv2D(64, 3, activation=\"relu\"),\n    layers.GlobalAveragePooling2D(),\n    layers.Dense(64, activation=\"relu\"),\n], name=\"embedding\")\n\nemb_a = base(inp_a)\nemb_b = base(inp_b)\n\n# L1 distance between embeddings\nl1 = layers.Lambda(lambda t: tf.abs(t&#91;0] - t&#91;1]), name=\"l1_distance\")(&#91;emb_a, emb_b])\noutputs = layers.Dense(1, activation=\"sigmoid\", name=\"similar\")(l1)\n\nmodel = keras.Model(&#91;inp_a, inp_b], outputs, name=\"siamese\")\n<\/code><\/pre>\n\n\n\n<p>The shared <code>base<\/code> stack learns a consistent representation, a common need in duplicate detection, metric learning, and recommender recall.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-practical-patterns-and-tips\">Practical patterns and tips<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-keep-shapes-explicit-and-stable\">Keep shapes explicit and stable<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Always specify <code>Input(shape=...)<\/code> fully, except the batch dimension.<\/li>\n\n\n\n<li>Use <code>Flatten<\/code>, <code>GlobalAveragePooling*<\/code>, or <code>Reshape<\/code> to make dimensionality clear before concatenation.<\/li>\n\n\n\n<li>Name layers and tensors to make summaries readable and logs searchable.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-modularize-with-reusable-blocks\">Modularize with reusable blocks<\/h3>\n\n\n\n<p>Wrap frequently used patterns into small functions that return tensors given an input tensor. It keeps graphs declarative and testable.<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-bc15dafd1f08018b6bdd4408d2381cfa\"><code>def residual_block(x, units, name):\n    h = layers.Dense(units, activation=\"relu\", name=f\"{name}_dense\")(x)\n    h = layers.Dense(x.shape&#91;-1], name=f\"{name}_proj\")(h)\n    return layers.Add(name=f\"{name}_add\")(&#91;x, h])\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-preprocessing-inside-the-model\">Preprocessing inside the model<\/h3>\n\n\n\n<p>Prefer Keras preprocessing layers (<code>TextVectorization<\/code>, <code>Normalization<\/code>, <code>CategoryEncoding<\/code>) to bake feature logic into the graph. That ensures consistent behavior between training and serving and simplifies deployment.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-serialization-and-deployment\">Serialization and deployment<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Functional models save cleanly to SavedModel or H5: <code>model.save(\"path\")<\/code>.<\/li>\n\n\n\n<li>Graph structure is preserved, enabling model introspection and automatic shape checks.<\/li>\n\n\n\n<li>Works with TensorFlow Serving, TFLite, and TF.js with minimal changes.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-performance-levers\">Performance levers<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Enable mixed precision on modern GPUs\/TPUs: <code>tf.keras.mixed_precision.set_global_policy(\"mixed_float16\")<\/code>.<\/li>\n\n\n\n<li>Scale out with <code>tf.distribute.MirroredStrategy()<\/code> or <code>MultiWorkerMirroredStrategy()<\/code>; model code stays the same.<\/li>\n\n\n\n<li>Profile with TensorBoard to spot bottlenecks in input pipelines or large concatenations.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-testing-and-maintainability\">Testing and maintainability<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Unit-test blocks by creating dummy <code>Input<\/code> tensors and asserting output shapes\/dtypes.<\/li>\n\n\n\n<li>Freeze and export subgraphs for reuse (e.g., an embedding tower) by creating a <code>Model<\/code> over intermediate tensors.<\/li>\n\n\n\n<li>Use <code>model.get_layer(name)<\/code> to inspect or swap components in experiments.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-troubleshooting-common-errors\">Troubleshooting common errors<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Shape mismatch on merge: Ensure both branches have the same last-dimension when using <code>Add<\/code>\/<code>Average<\/code>. For <code>Concatenate<\/code>, align all but the concat axis.<\/li>\n\n\n\n<li>None-type shape issues: Remember batch dimension is <code>None<\/code>. If you see unexpected <code>None<\/code> elsewhere, add explicit <code>Reshape<\/code> or pooling.<\/li>\n\n\n\n<li>Using Python control flow on tensors: Within the Functional graph, prefer Keras layers or <code>tf.where<\/code>\/<code>tf.cond<\/code> over raw Python <code>if<\/code>\/<code>for<\/code> that depend on tensor values.<\/li>\n\n\n\n<li>Unconnected graph: All outputs must trace back to defined <code>Input<\/code> objects. If not, you\u2019ll get an error when building the <code>Model<\/code>.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-executive-takeaways\">Executive takeaways<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Flexibility without boilerplate: Faster iteration on model ideas, less custom glue code.<\/li>\n\n\n\n<li>Production-ready graphs: Easy to save, inspect, and deploy across platforms.<\/li>\n\n\n\n<li>Team-friendly: Named layers, clear summaries, and modular blocks improve code reviews and handovers.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-wrap-up\">Wrap-up<\/h2>\n\n\n\n<p>The Keras Functional API gives you a clear, composable way to express complex deep learning models while staying productive. Start with well-named <code>Input<\/code>s, compose layers as functions, and lean on TensorFlow for execution, scaling, and deployment. With these patterns, you can go from prototype to production with fewer refactors\u2014and a graph your whole team can understand.<\/p>\n\n\n\n<ul class=\"wp-block-yoast-seo-related-links yoast-seo-related-links\">\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/15\/what-are-cypher-queries\/\">What Are Cypher Queries<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/08\/27\/what-are-tensors-in-ai-and-large-language-models-llms\/\">What Are Tensors in AI and Large Language Models (LLMs)?<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/07\/25\/understanding-transformers-the-architecture-driving-ai-innovation\/\">Understanding Transformers: The Architecture Driving AI Innovation<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/18\/get-started-with-tensors-with-pytorch\/\">Get Started With Tensors With PyTorch<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/18\/the-autonomy-of-tensors\/\">The Autonomy of Tensors<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>A clear, practical guide to Keras Functional API\u2014why it matters and how to build flexible deep learning models with branching, sharing, and custom workflows.<\/p>\n","protected":false},"author":1,"featured_media":53946,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_yoast_wpseo_focuskw":"Keras Functional API","_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"Uncover the power of the Keras Functional API for deep learning projects. Learn how it simplifies complex model creation.","_yoast_wpseo_opengraph-title":"","_yoast_wpseo_opengraph-description":"","_yoast_wpseo_twitter-title":"","_yoast_wpseo_twitter-description":"","_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[24,13,91],"tags":[],"class_list":["post-53931","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","category-blog","category-keras"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Keras Functional API - CPI Consulting<\/title>\n<meta name=\"description\" content=\"Uncover the power of the Keras Functional API for deep learning projects. Learn how it simplifies complex model creation.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/keras-functional-api\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Keras Functional API\" \/>\n<meta property=\"og:description\" content=\"Uncover the power of the Keras Functional API for deep learning projects. Learn how it simplifies complex model creation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/keras-functional-api\/\" \/>\n<meta property=\"og:site_name\" content=\"CPI Consulting\" \/>\n<meta property=\"article:published_time\" content=\"2025-09-25T00:39:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-25T00:39:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cloudproinc.com.au\/wp-content\/uploads\/2025\/09\/keras-functional-api-demystified-for-flexible-deep-learning-workflows.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1536\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"CPI Staff\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CPI Staff\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/keras-functional-api\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/keras-functional-api\\\/\"},\"author\":{\"name\":\"CPI Staff\",\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/#\\\/schema\\\/person\\\/192eeeb0ce91062126ce3822ae88fe6e\"},\"headline\":\"Keras Functional API\",\"datePublished\":\"2025-09-25T00:39:01+00:00\",\"dateModified\":\"2025-09-25T00:39:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/keras-functional-api\\\/\"},\"wordCount\":834,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/keras-functional-api\\\/#primaryimage\"},\"thumbnailUrl\":\"\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/keras-functional-api-demystified-for-flexible-deep-learning-workflows.png\",\"articleSection\":[\"AI\",\"Blog\",\"Keras\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/keras-functional-api\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/keras-functional-api\\\/\",\"url\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/keras-functional-api\\\/\",\"name\":\"Keras Functional API - CPI Consulting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/keras-functional-api\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/keras-functional-api\\\/#primaryimage\"},\"thumbnailUrl\":\"\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/keras-functional-api-demystified-for-flexible-deep-learning-workflows.png\",\"datePublished\":\"2025-09-25T00:39:01+00:00\",\"dateModified\":\"2025-09-25T00:39:04+00:00\",\"description\":\"Uncover the power of the Keras Functional API for deep learning projects. Learn how it simplifies complex model creation.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/keras-functional-api\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/keras-functional-api\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/keras-functional-api\\\/#primaryimage\",\"url\":\"\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/keras-functional-api-demystified-for-flexible-deep-learning-workflows.png\",\"contentUrl\":\"\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/keras-functional-api-demystified-for-flexible-deep-learning-workflows.png\",\"width\":1536,\"height\":1024},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/keras-functional-api\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Keras Functional API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/#website\",\"url\":\"https:\\\/\\\/cloudproinc.com.au\\\/\",\"name\":\"Cloud Pro Inc - CPI Consulting Pty Ltd\",\"description\":\"Cloud, AI &amp; Cybersecurity Consulting | Melbourne\",\"publisher\":{\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/cloudproinc.com.au\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/#organization\",\"name\":\"Cloud Pro Inc - Cloud Pro Inc - CPI Consulting Pty Ltd\",\"url\":\"https:\\\/\\\/cloudproinc.com.au\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/favfinalfile.png\",\"contentUrl\":\"\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/favfinalfile.png\",\"width\":500,\"height\":500,\"caption\":\"Cloud Pro Inc - Cloud Pro Inc - CPI Consulting Pty Ltd\"},\"image\":{\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/#\\\/schema\\\/person\\\/192eeeb0ce91062126ce3822ae88fe6e\",\"name\":\"CPI Staff\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g\",\"caption\":\"CPI Staff\"},\"sameAs\":[\"http:\\\/\\\/www.cloudproinc.com.au\"],\"url\":\"https:\\\/\\\/cloudproinc.com.au\\\/index.php\\\/author\\\/cpiadmin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Keras Functional API - CPI Consulting","description":"Uncover the power of the Keras Functional API for deep learning projects. Learn how it simplifies complex model creation.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/keras-functional-api\/","og_locale":"en_US","og_type":"article","og_title":"Keras Functional API","og_description":"Uncover the power of the Keras Functional API for deep learning projects. Learn how it simplifies complex model creation.","og_url":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/keras-functional-api\/","og_site_name":"CPI Consulting","article_published_time":"2025-09-25T00:39:01+00:00","article_modified_time":"2025-09-25T00:39:04+00:00","og_image":[{"width":1536,"height":1024,"url":"https:\/\/cloudproinc.com.au\/wp-content\/uploads\/2025\/09\/keras-functional-api-demystified-for-flexible-deep-learning-workflows.png","type":"image\/png"}],"author":"CPI Staff","twitter_card":"summary_large_image","twitter_misc":{"Written by":"CPI Staff","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/keras-functional-api\/#article","isPartOf":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/keras-functional-api\/"},"author":{"name":"CPI Staff","@id":"https:\/\/cloudproinc.com.au\/#\/schema\/person\/192eeeb0ce91062126ce3822ae88fe6e"},"headline":"Keras Functional API","datePublished":"2025-09-25T00:39:01+00:00","dateModified":"2025-09-25T00:39:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/keras-functional-api\/"},"wordCount":834,"commentCount":0,"publisher":{"@id":"https:\/\/cloudproinc.com.au\/#organization"},"image":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/keras-functional-api\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2025\/09\/keras-functional-api-demystified-for-flexible-deep-learning-workflows.png","articleSection":["AI","Blog","Keras"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/keras-functional-api\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/keras-functional-api\/","url":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/keras-functional-api\/","name":"Keras Functional API - CPI Consulting","isPartOf":{"@id":"https:\/\/cloudproinc.com.au\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/keras-functional-api\/#primaryimage"},"image":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/keras-functional-api\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2025\/09\/keras-functional-api-demystified-for-flexible-deep-learning-workflows.png","datePublished":"2025-09-25T00:39:01+00:00","dateModified":"2025-09-25T00:39:04+00:00","description":"Uncover the power of the Keras Functional API for deep learning projects. Learn how it simplifies complex model creation.","breadcrumb":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/keras-functional-api\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/keras-functional-api\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/keras-functional-api\/#primaryimage","url":"\/wp-content\/uploads\/2025\/09\/keras-functional-api-demystified-for-flexible-deep-learning-workflows.png","contentUrl":"\/wp-content\/uploads\/2025\/09\/keras-functional-api-demystified-for-flexible-deep-learning-workflows.png","width":1536,"height":1024},{"@type":"BreadcrumbList","@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/keras-functional-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.cloudproinc.com.au\/"},{"@type":"ListItem","position":2,"name":"Keras Functional API"}]},{"@type":"WebSite","@id":"https:\/\/cloudproinc.com.au\/#website","url":"https:\/\/cloudproinc.com.au\/","name":"Cloud Pro Inc - CPI Consulting Pty Ltd","description":"Cloud, AI &amp; Cybersecurity Consulting | Melbourne","publisher":{"@id":"https:\/\/cloudproinc.com.au\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudproinc.com.au\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cloudproinc.com.au\/#organization","name":"Cloud Pro Inc - Cloud Pro Inc - CPI Consulting Pty Ltd","url":"https:\/\/cloudproinc.com.au\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudproinc.com.au\/#\/schema\/logo\/image\/","url":"\/wp-content\/uploads\/2022\/01\/favfinalfile.png","contentUrl":"\/wp-content\/uploads\/2022\/01\/favfinalfile.png","width":500,"height":500,"caption":"Cloud Pro Inc - Cloud Pro Inc - CPI Consulting Pty Ltd"},"image":{"@id":"https:\/\/cloudproinc.com.au\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/cloudproinc.com.au\/#\/schema\/person\/192eeeb0ce91062126ce3822ae88fe6e","name":"CPI Staff","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g","caption":"CPI Staff"},"sameAs":["http:\/\/www.cloudproinc.com.au"],"url":"https:\/\/cloudproinc.com.au\/index.php\/author\/cpiadmin\/"}]}},"jetpack_featured_media_url":"\/wp-content\/uploads\/2025\/09\/keras-functional-api-demystified-for-flexible-deep-learning-workflows.png","jetpack-related-posts":[{"id":53934,"url":"https:\/\/cloudproinc.com.au\/index.php\/2025\/09\/25\/build-a-keras-model-for-real-projects\/","url_meta":{"origin":53931,"position":0},"title":"Build a Keras Model for Real Projects","author":"CPI Staff","date":"September 25, 2025","format":false,"excerpt":"Learn how to design, train, and deploy Keras models using TensorFlow\u2014from data prep to production-ready saves\u2014with practical code, clear steps, and tips for speed, accuracy, and maintainability.","rel":"","context":"In &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/cloudproinc.com.au\/index.php\/category\/ai\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2025\/09\/build-a-keras-model-for-real-projects-from-idea-to-deployment.png","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2025\/09\/build-a-keras-model-for-real-projects-from-idea-to-deployment.png 1x, \/wp-content\/uploads\/2025\/09\/build-a-keras-model-for-real-projects-from-idea-to-deployment.png 1.5x, \/wp-content\/uploads\/2025\/09\/build-a-keras-model-for-real-projects-from-idea-to-deployment.png 2x, \/wp-content\/uploads\/2025\/09\/build-a-keras-model-for-real-projects-from-idea-to-deployment.png 3x, \/wp-content\/uploads\/2025\/09\/build-a-keras-model-for-real-projects-from-idea-to-deployment.png 4x"},"classes":[]},{"id":53933,"url":"https:\/\/cloudproinc.com.au\/index.php\/2025\/09\/25\/deploy-a-model-with-tensorflow-serving\/","url_meta":{"origin":53931,"position":1},"title":"Deploy a Model with TensorFlow Serving","author":"CPI Staff","date":"September 25, 2025","format":false,"excerpt":"Learn to package, serve, and scale TensorFlow models using Docker and Kubernetes with TensorFlow Serving. Practical steps, code, and production tips for teams.","rel":"","context":"In &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/cloudproinc.com.au\/index.php\/category\/ai\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2025\/09\/deploy-a-model-with-tensorflow-serving-on-docker-and-kubernetes.png","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2025\/09\/deploy-a-model-with-tensorflow-serving-on-docker-and-kubernetes.png 1x, \/wp-content\/uploads\/2025\/09\/deploy-a-model-with-tensorflow-serving-on-docker-and-kubernetes.png 1.5x, \/wp-content\/uploads\/2025\/09\/deploy-a-model-with-tensorflow-serving-on-docker-and-kubernetes.png 2x, \/wp-content\/uploads\/2025\/09\/deploy-a-model-with-tensorflow-serving-on-docker-and-kubernetes.png 3x, \/wp-content\/uploads\/2025\/09\/deploy-a-model-with-tensorflow-serving-on-docker-and-kubernetes.png 4x"},"classes":[]},{"id":53929,"url":"https:\/\/cloudproinc.com.au\/index.php\/2025\/09\/25\/turn-a-list-into-a-tensor-in-python\/","url_meta":{"origin":53931,"position":2},"title":"Turn a List into a Tensor in Python","author":"CPI Staff","date":"September 25, 2025","format":false,"excerpt":"Learn how to convert Python lists into tensors using NumPy, PyTorch, and TensorFlow, with tips on shapes, dtypes, performance, and common pitfalls.","rel":"","context":"In &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/cloudproinc.com.au\/index.php\/category\/ai\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2025\/09\/turn-a-list-into-a-tensor-in-python-with-numpy-pytorch-tensorflow.png","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2025\/09\/turn-a-list-into-a-tensor-in-python-with-numpy-pytorch-tensorflow.png 1x, \/wp-content\/uploads\/2025\/09\/turn-a-list-into-a-tensor-in-python-with-numpy-pytorch-tensorflow.png 1.5x, \/wp-content\/uploads\/2025\/09\/turn-a-list-into-a-tensor-in-python-with-numpy-pytorch-tensorflow.png 2x, \/wp-content\/uploads\/2025\/09\/turn-a-list-into-a-tensor-in-python-with-numpy-pytorch-tensorflow.png 3x, \/wp-content\/uploads\/2025\/09\/turn-a-list-into-a-tensor-in-python-with-numpy-pytorch-tensorflow.png 4x"},"classes":[]},{"id":53573,"url":"https:\/\/cloudproinc.com.au\/index.php\/2025\/08\/06\/how-to-code-and-build-a-gpt-large-language-model\/","url_meta":{"origin":53931,"position":3},"title":"How to Code and Build a GPT Large Language Model","author":"CPI Staff","date":"August 6, 2025","format":false,"excerpt":"In this blog post, you\u2019ll learn how to code and build a GPT LLM from scratch or fine-tune an existing one. We\u2019ll cover the architecture, key tools, libraries, frameworks, and essential resources to get you started fast. Table of contentsUnderstanding GPT LLM ArchitectureModel Architecture DiagramTools and Libraries to Build a\u2026","rel":"","context":"In &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/cloudproinc.com.au\/index.php\/category\/ai\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2025\/08\/CreateLLM.png","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2025\/08\/CreateLLM.png 1x, \/wp-content\/uploads\/2025\/08\/CreateLLM.png 1.5x, \/wp-content\/uploads\/2025\/08\/CreateLLM.png 2x, \/wp-content\/uploads\/2025\/08\/CreateLLM.png 3x, \/wp-content\/uploads\/2025\/08\/CreateLLM.png 4x"},"classes":[]},{"id":53930,"url":"https:\/\/cloudproinc.com.au\/index.php\/2025\/09\/25\/deploying-deep-learning-models\/","url_meta":{"origin":53931,"position":4},"title":"Deploying Deep Learning Models","author":"CPI Staff","date":"September 25, 2025","format":false,"excerpt":"A practical guide to serving deep learning models as secure, scalable REST APIs using FastAPI, Docker, and Kubernetes\u2014covering performance, security, and monitoring for production.","rel":"","context":"In &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/cloudproinc.com.au\/index.php\/category\/ai\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2025\/09\/deploying-deep-learning-models-as-fast-secure-rest-apis-in-production.png","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2025\/09\/deploying-deep-learning-models-as-fast-secure-rest-apis-in-production.png 1x, \/wp-content\/uploads\/2025\/09\/deploying-deep-learning-models-as-fast-secure-rest-apis-in-production.png 1.5x, \/wp-content\/uploads\/2025\/09\/deploying-deep-learning-models-as-fast-secure-rest-apis-in-production.png 2x, \/wp-content\/uploads\/2025\/09\/deploying-deep-learning-models-as-fast-secure-rest-apis-in-production.png 3x, \/wp-content\/uploads\/2025\/09\/deploying-deep-learning-models-as-fast-secure-rest-apis-in-production.png 4x"},"classes":[]},{"id":57372,"url":"https:\/\/cloudproinc.com.au\/index.php\/2026\/04\/03\/googles-ai-threat-landscape-report-signals-five-risks-every-australian-ciso-should-act-on-now\/","url_meta":{"origin":53931,"position":5},"title":"Google&#8217;s AI Threat Landscape Report Signals Five Risks Every Australian CISO Should Act On Now","author":"CPI Staff","date":"April 3, 2026","format":false,"excerpt":"Google's Threat Intelligence Group just published one of the most detailed reports to date on how adversaries are using AI to accelerate attacks. For Australian CISOs, five findings demand immediate attention. The GTIG AI Threat Tracker, published in early 2026 and based on Q4 2025 observations, moves the conversation beyond\u2026","rel":"","context":"In &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/cloudproinc.com.au\/index.php\/category\/ai\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2026\/04\/googles-ai-threat-landscape-report-five-risks-australian-ciso-cover.png","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2026\/04\/googles-ai-threat-landscape-report-five-risks-australian-ciso-cover.png 1x, \/wp-content\/uploads\/2026\/04\/googles-ai-threat-landscape-report-five-risks-australian-ciso-cover.png 1.5x, \/wp-content\/uploads\/2026\/04\/googles-ai-threat-landscape-report-five-risks-australian-ciso-cover.png 2x, \/wp-content\/uploads\/2026\/04\/googles-ai-threat-landscape-report-five-risks-australian-ciso-cover.png 3x, \/wp-content\/uploads\/2026\/04\/googles-ai-threat-landscape-report-five-risks-australian-ciso-cover.png 4x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/posts\/53931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/comments?post=53931"}],"version-history":[{"count":2,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/posts\/53931\/revisions"}],"predecessor-version":[{"id":53951,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/posts\/53931\/revisions\/53951"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/media\/53946"}],"wp:attachment":[{"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/media?parent=53931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/categories?post=53931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/tags?post=53931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}