{"id":179504,"date":"2023-10-18T14:45:25","date_gmt":"2023-10-18T13:45:25","guid":{"rendered":"https:\/\/liora.io\/en\/?p=179504"},"modified":"2026-02-12T11:11:34","modified_gmt":"2026-02-12T10:11:34","slug":"dense-neural-networks-understanding-their-structure-and-function","status":"publish","type":"post","link":"https:\/\/liora.io\/en\/dense-neural-networks-understanding-their-structure-and-function","title":{"rendered":"Dense Neural Networks: Understanding Their Structure and Function"},"content":{"rendered":"\n<p><strong>When designing a <a href=\"https:\/\/liora.io\/deep-neural-network\">deep neural network<\/a>, several types of first-level architecture can be used. One of these is the dense neural network. So what is it? And how does it work? Find out in this article.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-is-a-dense-neural-network\">What is a dense neural network?<\/h2>\n\n\n\n<p>A <strong>dense neural network<\/strong> is a <a href=\"https:\/\/liora.io\/en\/boosting-business-with-3-essential-machine-learning-algorithms\">machine learning<\/a> model in which each layer is deeply connected to the previous layer. As a reminder, layers are made up of nodes. Nodes combine inputs from a dataset with a weighted coefficient, to increase or decrease their value. In doing so, they perform calculations on the data.<\/p>\n\n\n\n<p>If we take the example of a stadium, the nodes are the seats, the <strong>layers are the rows of seats.<\/strong> And the whole makes up the architecture of the model itself (or the stadium in its entirety). Within a model, each layer has its own importance, depending on its characteristics and functionalities. Some are used for time series analysis, others for image processing, and still others for <a href=\"https:\/\/liora.io\/en\/natural-language-processing-definition-and-principles\">natural language processing.<\/a> Returning to the dense neural network, the neurons in one layer are connected to all the neurons in the previous layer. Because of this ultra-connectivity, this is the model most commonly used in artificial neural networks.<\/p>\n\n\n\n<p><strong>Good to know: <\/strong>even though we speak of a dense neural network, dense layers (or deeply connected layers) are not necessarily used from the beginning to the end of the learning process.<\/p>\n\n\n\n<p>They are often only used in the final stages of the <a href=\"https:\/\/liora.io\/en\/u-net-computer-visions-neural-network\">neural network.<\/a> In this case, other types of layers will be used.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-how-does-the-dense-neural-network-work\">How does the dense neural network work?<\/h2>\n\n\n\n<p>In a <strong>dense neural network<\/strong>, the dense layer receives an output from the neuron in the previous layer. The input data thus transmitted is in the form of a matrix. And to facilitate the connection between all layers, a vector multiplication of the matrix is applied. This allows the output to be modified and the next step to be taken. But please note that matrix-vector multiplication means that the row vector of the output is equal to the column vector of the dense layer.<\/p>\n\n\n\n<p>In other words, for this to work, there must be as many columns between the two vectors. It&#8217;s this whole process that enables the network to create connections between the available data values. To help you better understand how the dense <a href=\"https:\/\/liora.io\/en\/recurrent-neural-network-what-is-it\">neural network works<\/a>, let&#8217;s take a look at its implementation using the Keras tool.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img decoding=\"async\" src=\"https:\/\/liora.io\/app\/uploads\/2023\/07\/dense-neural-network-1.png\" alt=\"\" style=\"width:1000px;height:auto\" title=\"\" \/><\/figure>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex is-content-justification-center wp-container-core-buttons-is-layout-a89b3969\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/liora.io\/en\/courses\/\">Training in artificial intelligence<\/a><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-how-to-implement-the-dense-neural-network-with-keras\">How to implement the dense neural network with Keras?<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-keras-api\">Keras API<\/h3>\n\n\n\n<p>To set up a dense neural network, you need a high-performance tool. One of the most commonly used is Keras. This is a <a href=\"https:\/\/liora.io\/en\/programming-and-documenting-an-api-with-python-flask-swagger-and-connexion\">Python API<\/a> that <a href=\"https:\/\/liora.io\/en\/tensorflow-course-where-to-learn-how-to-use-the-framework\">runs on the Tensorflow machine learning platform.<\/a> This API enables users to add several pre-built layers to different neural network architectures. Thanks to its intuitive interface and rapid deployment in production, Keras facilitates the overall experience on TensorFlow.<\/p>\n\n\n\n<p>For example, to create a machine learning model, the various Keras layers need to be stacked. It is then possible to use a single dense layer to design a linear regression model. Or several dense layers to create a truly <strong>dense neural network.<\/strong><\/p>\n\n\n\n<p><strong>Good to know:<\/strong> the Keras API contains different types of layers, such as output layers, activation layers, integration layers and, of course, dense layers. Let&#8217;s take a look at the different parameters used for the latter.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-keras-hyperparameters\">Keras hyperparameters<\/h3>\n\n\n\n<p>To design a dense neural network, Keras provides its users with a complete syntax, made up of several hyperparameters and attributes. Here are the most important ones:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Units:<\/strong> defines the size of the dense layer output. It is always a positive integer.<\/li>\n\n\n\n<li><strong>Activation:<\/strong> transforms neuron input values. By introducing non-linearity, neural networks are able to understand the relationship between input and output values.<\/li>\n\n\n\n<li><strong>The kernel weight matrix:<\/strong> this is the heart of the neural network. This matrix is used to multiply input data and extract its main characteristics. Here, several parameters can be used to initialize, regularize or constrain the matrix.<\/li>\n\n\n\n<li><strong>The bias vector:<\/strong> these are the additional data sets that require no input and correspond to the output layer. As such, it is set to 0. Here again, several parameters can be applied (initialization, constraint and regularization).<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-things-to-remember\">Things to remember<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>In a<strong> dense neural network,<\/strong> the results of the previous layers are transmitted to the dense layer.<\/li>\n\n\n\n<li>There is thus hyperconnection between the different layers making up the architecture of the learning model.<\/li>\n\n\n\n<li>Several tools are available to implement this learning model. Keras, for example, provides a complete syntax. This makes the work of data scientists much easier.<\/li>\n\n\n\n<li>That said, to fully master the design of a dense neural network, it&#8217;s best to train in data science.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img decoding=\"async\" src=\"https:\/\/liora.io\/app\/uploads\/2023\/07\/dense-neural-network-2.png\" alt=\"\" style=\"width:1000px;height:auto\" title=\"\" \/><\/figure>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex is-content-justification-center wp-container-core-buttons-is-layout-a89b3969\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/liora.io\/en\/courses\/\">Discover our artificial intelligence training<\/a><\/div>\n<\/div>\n\n\n\n<script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"FAQPage\",\n  \"mainEntity\": [\n    {\n      \"@type\": \"Question\",\n      \"name\": \"What is a dense neural network?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"A dense neural network is a machine learning model in which each layer is deeply connected to the previous layer, with neurons combining inputs with weighted coefficients to perform calculations on the data.\u00a0([liora.io](https:\/\/liora.io\/en\/dense-neural-networks-understanding-their-structure-and-function))\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"How does a dense neural network work?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"In a dense neural network, dense layers receive outputs from the previous layer and use matrix\u2013vector multiplication to modify the input data before passing it to the next layer.\u00a0([liora.io](https:\/\/liora.io\/en\/dense-neural-networks-understanding-their-structure-and-function))\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"How do you implement a dense neural network with Keras?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"To implement a dense neural network with Keras, you stack various pre\u2011built layers and can use a single dense layer for linear regression or several to build a full dense network.\u00a0([liora.io](https:\/\/liora.io\/en\/dense-neural-networks-understanding-their-structure-and-function))\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"What are the main Keras hyperparameters for dense layers?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"Important hyperparameters include units (size of dense layer output), activation (introducing non\u2011linearity), kernel weight matrix (for multiplying input data), and the bias vector.\u00a0([liora.io](https:\/\/liora.io\/en\/dense-neural-networks-understanding-their-structure-and-function))\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"What are key points to remember about dense neural networks?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"Key points include that results from previous layers feed into dense layers, creating hyperconnection across the model, and tools like Keras provide a complete syntax to design these networks.\u00a0([liora.io](https:\/\/liora.io\/en\/dense-neural-networks-understanding-their-structure-and-function))\"\n      }\n    }\n  ]\n}\n<\/script>\n\n","protected":false},"excerpt":{"rendered":"<p>When designing a deep neural network, several types of first-level architecture can be used. One of these is the dense neural network. So what is it? And how does it work? Find out in this article. What is a dense neural network? A dense neural network is a machine learning model in which each layer [&hellip;]<\/p>\n","protected":false},"author":55,"featured_media":179506,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"editor_notices":[],"footnotes":""},"categories":[2433],"class_list":["post-179504","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-ai"],"acf":[],"_links":{"self":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/179504","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/users\/55"}],"replies":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/comments?post=179504"}],"version-history":[{"count":3,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/179504\/revisions"}],"predecessor-version":[{"id":206559,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/179504\/revisions\/206559"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/media\/179506"}],"wp:attachment":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/media?parent=179504"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/categories?post=179504"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}