{"id":1749,"date":"2021-12-29T12:01:18","date_gmt":"2021-12-29T06:31:18","guid":{"rendered":"https:\/\/blog.nuventure.in\/?p=1749"},"modified":"2026-10-28T12:30:16","modified_gmt":"2026-10-28T07:00:16","slug":"neural-networks-explained-how-they-work","status":"publish","type":"post","link":"https:\/\/nuventure.com\/blog\/2021\/12\/29\/neural-networks-explained-how-they-work\/","title":{"rendered":"How Neural Networks Work: Artificial Neural Networks Explained"},"content":{"rendered":"\n<p>In machine learning, an algorithm is only as good as the data it was trained on. Learning from experience is the whole point. Without machine learning, we would have to manually program a huge number of &#8220;if&#8221; and &#8220;if-else&#8221; conditions just to help a computer tell a car from a human being.<\/p>\n\n\n\n<p>Neural networks are one of the most important tools machine learning offers, and gradient descent is the method that trains them. In this guide, you will learn what an artificial neural network is, how neural networks work, how loss and cost functions measure mistakes, and how gradient descent fixes them.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What Is an Artificial Neural Network (ANN)?<\/strong><\/h2>\n\n\n\n<p>An artificial neural network (ANN) is a machine learning model made of connected artificial neurons, loosely inspired by the human brain. Each neuron takes inputs, multiplies them by weights, adds a bias and passes the result through an activation function. By adjusting those weights during training, the network learns to recognize patterns.<\/p>\n\n\n\n<p>Neural networks are the basis for everything from digital assistants to <a href=\"https:\/\/nuventure.com\/blog\/2020\/04\/01\/yeah-were-in-the-future-we-have-driverless-cars-i-guess\/\">self-driving cars<\/a>, <a href=\"https:\/\/nuventure.com\/blog\/2020\/06\/23\/what-is-edge-ai-and-why-is-it-important-advantages-and-disadvantages-of-ai-on-cloud-and-ai-on-edge\/\">edge AI<\/a> and <a href=\"https:\/\/nuventure.com\/blog\/category\/technology\/ai\/page\/3\/\">just about everything in AI<\/a>.<\/p>\n\n\n\n<p>To understand how an ANN works, it helps to look first at the brain it imitates.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How Neurons in the Brain Work<\/strong><\/h2>\n\n\n\n<p>The human brain is made of billions of neurons. The connections between them determine how we understand things and make decisions. The brain is incredibly plastic: the number of neurons stays more or less constant through life, but the connections keep changing. New ones form, and old ones weaken or grow stronger.<\/p>\n\n\n\n<p>For our purposes, picture a neuron as a line segment. It receives signals at one end and sends signals out of the other. A single neuron can receive signals from, and send signals to, many other neurons.<\/p>\n\n\n\n<p>Not all signals are equal. If several neurons send signals at the same time, the combined signal is stronger. And a neuron does not fire for every signal. It has a minimum signal strength, called the action potential, that it needs before it fires.<\/p>\n\n\n\n<p>One of the thumb rules for how connections form is: &#8220;neurons that fire together, wire together.&#8221; Pavlov&#8217;s dog shows this well.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Pavlov&#8217;s Dog: How Connections Form<\/strong><\/h2>\n\n\n\n<p><a href=\"https:\/\/www.simplypsychology.org\/pavlov.html\">Ivan Pavlov measured how much saliva his dog produced when offered food<\/a>. Then, before each feeding, he rang a bell. After a while, he rang the bell alone, and the dog still produced saliva. The dog&#8217;s brain had learned to associate the bell with food.<\/p>\n\n\n\n<p>Picture one neuron that identifies food, one that produces saliva and one that identifies the bell. (In reality, each would be a complex neural network.) The food neuron and the saliva neuron were already connected, so one firing triggered the other. During the experiment, the bell neuron fired at the same time as the food neuron, and it developed a connection to it. That is how training works.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How Neural Networks Solve a Problem<\/strong><\/h2>\n\n\n\n<p>The brain solves problems in a similar way. Suppose it has to decide whether a picture shows a dog. Many factors hint at it. Four legs suggest a dog, but so do other animals have four legs. Dogs usually have fur, but not always. Dogs have two eyes, but so do most animals. Each factor is only a correlation, and together they lead to a conclusion.<\/p>\n\n\n\n<p>Each factor gets a neuron, and all of them connect to a final neuron that says &#8220;yes, this is a dog.&#8221; The strength of each connection depends on how much that factor matters. A thick coat points to a dog more strongly than four legs does, so its connection is stronger. When enough factors fire together, the signal passes the final neuron&#8217;s action potential, and the decision is made.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How Do Artificial Neural Networks Work?<\/strong><\/h2>\n\n\n\n<p>In an artificial neural network, the strength of a connection between neurons is represented by a <strong>weight<\/strong>. Artificial neurons, like real ones, receive inputs from many neurons and send their output to many others. Each input is multiplied by its weight, so important factors count for more.<\/p>\n\n\n\n<p>Take the dog example. Two input neurons, &#8220;has four legs&#8221; and &#8220;has a thick coat,&#8221; feed the neuron that lights up for &#8220;dog.&#8221; Both give an input of 1. The thick coat input is multiplied by 4 and the four-legs input by 2, because a thick coat is a stronger sign of a dog. The total input is 6.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Threshold, or Bias<\/strong><\/h2>\n\n\n\n<p>An artificial neuron does not fire every time it gets a signal either. If the total signal is 6 and the neuron&#8217;s threshold is 8, it does not fire, so it doesn&#8217;t output &#8220;dog.&#8221;<\/p>\n\n\n\n<p>In ANNs, the threshold is called the <strong>bias<\/strong>. Technically, the bias is the negative of the threshold. If the threshold is 4, the bias is \u22124.<\/p>\n\n\n\n<p>So three things decide whether a neuron fires: the inputs it receives, the weights attached to them and the bias.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>The Activation Function of a Neural Network<\/strong><\/h2>\n\n\n\n<p>The activation function is how a neuron&#8217;s output is calculated. In its simplest form, you multiply each input by its weight, add them up and subtract the bias:<\/p>\n\n\n\n<p>Y = x1w1 + x2w2 + x3w3 + \u2026 \u2212 B<\/p>\n\n\n\n<p>Here x1, x2, x3 are the inputs, w1, w2, w3 are the weights and B is the bias. The result can range from negative infinity to positive infinity, so it is often squeezed into a fixed range. The simplest version outputs 1 if Y &gt; 0 and 0 otherwise.<\/p>\n\n\n\n<p>Real networks use other activation functions, such as sigmoid, ReLU and softmax, depending on the problem. Some aspects of this don&#8217;t map exactly to biological neurons, but the idea is the same.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How Neural Networks Are Trained<\/strong><\/h2>\n\n\n\n<p>A neural network is only as good as its training and the data used to train it. The brain learns from experience by strengthening and weakening connections. An artificial network does the same with data.<\/p>\n\n\n\n<p>To build a network that detects dogs, you need many pictures, some with dogs and some without. These form the training data set. You feed in the pictures along with the expected output, for example 1 for &#8220;dog detected&#8221; and 0 for &#8220;no dog.&#8221; An image goes in as pixel data, so in effect, numbers go in and a number comes out.<\/p>\n\n\n\n<p>Training means finding the combination of weights and biases for every neuron that gives the right outputs. Since you know the inputs and the expected outputs, it resembles solving an equation, except with far too many variables to solve directly. Trying every combination would take too much time and computing power. So we need a way to measure how wrong the network is, and a systematic way to reduce that error.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Loss Function vs Cost Function<\/strong><\/h2>\n\n\n\n<p>To improve a network, we first need to know how far its output is from the expected output. That is the job of the loss and cost functions.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Loss function:<\/strong> the error for a single training example.<\/li>\n\n\n\n<li><strong>Cost function:<\/strong> the average (or sum) of the losses across the entire training set.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><\/th><th>Loss function<\/th><th>Cost function<\/th><\/tr><\/thead><tbody><tr><td>Measures<\/td><td>Error on one training example<\/td><td>Error across the whole training set<\/td><\/tr><tr><td>Used for<\/td><td>Judging a single prediction<\/td><td>Judging the network&#8217;s overall performance<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Training aims to reduce the cost to a minimum by fine-tuning the weights and biases. Which function you use depends on the problem.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">When the output can be any number<\/h3>\n\n\n\n<p>Say you want to predict a person&#8217;s salary from their age and experience, using data for 10,000 people. The output could be almost any number. The error for one example is the difference between the actual and predicted values:<\/p>\n\n\n\n<p>Error = actual output \u2212 predicted output<\/p>\n\n\n\n<p>Averaging these gives the Mean Error. But errors can be negative. If the actual salary is $10k and the network predicts $9k, the error is positive, but predicting $11k gives a negative error, and the errors can cancel each other out to zero. To avoid that, we use the <strong>Mean Squared Error (MSE)<\/strong>, the average of the squared errors, or the <strong>Mean Absolute Error<\/strong>, the average of the absolute errors.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">When the output is a category<\/h3>\n\n\n\n<p>For classification problems, such as dog or no dog, or dog, cat or fish, the output is not just any number. The model gives a probability for each class. For a picture, it might say:<\/p>\n\n\n\n<p>Y = [0.23, 0.57, 0.20] (fish, dog, cat)<\/p>\n\n\n\n<p>The class with the highest probability, here dog, becomes the prediction. (This kind of output usually comes from a softmax activation function.) If the picture really shows a dog, the expected output is:<\/p>\n\n\n\n<p>Y\u2032 = [0, 1, 0]<\/p>\n\n\n\n<p>For a fish it would be [1, 0, 0] and for a cat [0, 0, 1].<\/p>\n\n\n\n<p>The loss measures the distance between the two probability distributions, using a function called <strong>cross-entropy<\/strong>:<\/p>\n\n\n\n<p>Loss = \u2212(y1\u00b7log P1 + y2\u00b7log P2 + y3\u00b7log P3)<\/p>\n\n\n\n<p>For our example:<\/p>\n\n\n\n<p>Loss = \u2212(0\u00b7log 0.23 + 1\u00b7log 0.57 + 0\u00b7log 0.20) = \u2212log 0.57 \u2248 0.56<\/p>\n\n\n\n<p>With more classes, the equation simply gets longer. The cost is the average (or sum) of the losses across all training examples. The closer the network&#8217;s probability for the right class is to 1, the lower the loss.<\/p>\n\n\n\n<p>Now we know how inaccurate the network is. The next step is to reduce that error, which is where gradient descent comes in.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Gradient Descent Explained<\/strong><\/h2>\n\n\n\n<p>Gradient descent is an optimization algorithm that minimizes the cost function by repeatedly adjusting the weights in the direction that reduces the error most, using the slope (gradient) of the cost function.<\/p>\n\n\n\n<p>Picture this: you are programming a rover to find the deepest point of a pond, but you don&#8217;t know where the bottom is. The rover has sensors that tell it whether it is going down or the ground is level. At the bottom, its position stops changing, and that&#8217;s how it knows it has arrived.<\/p>\n\n\n\n<p>Gradient descent works the same way. We don&#8217;t know the best weights in advance, but we can tell whether each step takes us closer. The bottom of the pond is where the error is lowest. Each step is a change to the weights. If the error goes down, we are moving in the right direction, and when the error stops changing, we have found the minimum. Real networks have many more than three weights, but the idea holds.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Gradient descent: some math<\/h3>\n\n\n\n<p>Start with a simple case: one weight to find. Let the cost function be:<\/p>\n\n\n\n<p>f(x) = x\u00b2 \u2212 x + 1<\/p>\n\n\n\n<p>Think of this as a curve with a lowest point. We could plot every value of x to find it, but it is easier to check which way the slope points and step in that direction. The first derivative gives the slope at any point:<\/p>\n\n\n\n<p>f\u2032(x) = 2x \u2212 1<\/p>\n\n\n\n<p>Suppose we start at x = 9. There, the cost is 73 and the slope is 17. The gradient descent update rule is:<\/p>\n\n\n\n<p>x_new = x_old \u2212 learning rate \u00d7 gradient<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Learning rate<\/h3>\n\n\n\n<p>The learning rate is the size of each step toward the bottom of the pond. It matters a lot. If the rover takes tiny steps, it may need a very long time to reach the bottom. If the steps are too big, it may overshoot the bottom and have to come back.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Working through the example<\/h3>\n\n\n\n<p>We choose a learning rate of 0.1.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Step 1: x = 9 \u2212 (0.1 \u00d7 17) = 7.3. The cost is 7.3\u00b2 \u2212 7.3 + 1 = 46.99.<\/li>\n\n\n\n<li>Step 2: the slope at 7.3 is 2(7.3) \u2212 1 = 13.6. So x = 7.3 \u2212 (0.1 \u00d7 13.6) = 5.94. The cost is 5.94\u00b2 \u2212 5.94 + 1 \u2248 30.34.<\/li>\n<\/ul>\n\n\n\n<p>The cost keeps going down. With one variable, you might guess your way to the answer, but you can&#8217;t just tell a computer to wing it, and it stops working when there are many variables.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">More than one weight<\/h3>\n\n\n\n<p>Neural networks have many weights, so consider a cost function with two variables:<\/p>\n\n\n\n<p>f(x, y) = x\u00b2 + y\u00b2<\/p>\n\n\n\n<p>Picture a 3D surface or a mountain range, where x and y set the position and f sets the height. To find the lowest point, we use <strong>partial derivatives<\/strong>. A partial derivative measures the slope along one axis while holding the other variable constant, like taking a thin slice through the mountain range. That leaves one variable, and the slope works as before.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u2202f\/\u2202x = 2x<\/li>\n\n\n\n<li>\u2202f\/\u2202y = 2y<\/li>\n<\/ul>\n\n\n\n<p>Each weight is updated with its own slope:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>x_new = x_old \u2212 learning rate \u00d7 \u2202f\/\u2202x<\/li>\n\n\n\n<li>y_new = y_old \u2212 learning rate \u00d7 \u2202f\/\u2202y<\/li>\n<\/ul>\n\n\n\n<p>Say we start at x = 5 and y = 10, so the cost is 25 + 100 = 125. With a learning rate of 0.1:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>x = 5 \u2212 (0.1 \u00d7 10) = 4<\/li>\n\n\n\n<li>y = 10 \u2212 (0.1 \u00d7 20) = 8<\/li>\n\n\n\n<li>New cost = 16 + 64 = 80<\/li>\n<\/ul>\n\n\n\n<p>Repeating this process keeps lowering the cost.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Scaling up to a full neural network<\/h3>\n\n\n\n<p>Networks can have thousands of weights, and large modern models have millions or even billions. The process is the same:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Assign random starting weights.<\/li>\n\n\n\n<li>Calculate the cost function.<\/li>\n\n\n\n<li>Update every weight with the same rule.<\/li>\n\n\n\n<li>Repeat until the cost is zero or close to it.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Challenges in Training Neural Networks<\/strong><\/h2>\n\n\n\n<p>Choosing the learning rate carefully matters. With thousands of weights, a huge training set and a complicated cost function, even calculating the cost once takes a lot of computing power, so taking too many steps is expensive.<\/p>\n\n\n\n<p>Another issue is that the cost surface is not always a smooth bowl. Like a pond or mountain range, it can have small pits that are deep compared to their surroundings but are not the deepest point. The network can get stuck there, a problem known as a local minimum. Starting from random weights helps. Other techniques, such as stochastic and mini-batch gradient descent, use only part of the training data at a time.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Putting Neural Networks into Practice with Python<\/strong><\/h2>\n\n\n\n<p>Understanding the math is the first step. To apply it, Python&#8217;s data and machine learning libraries are a common place to start. Our guide to <a href=\"https:\/\/nuventure.com\/blog\/2024\/07\/29\/python-data-analytics-for-big-data-business-insights\/\">Python data analytics<\/a> shows what the ecosystem offers for big data, visualization and machine learning.<br><br><a href=\"https:\/\/nuventure.com\/contact-us\/\" data-type=\"link\" data-id=\"https:\/\/nuventure.com\/contact-us\/\">Connect with Nuventure for custom AI solutions.<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Frequently Asked Questions<\/strong><\/h2>\n\n\n\n<p><strong>How do neural networks work?<\/strong><br>A neural network passes inputs through layers of artificial neurons. Each neuron multiplies its inputs by weights, adds a bias and applies an activation function. During training, the network compares its output with the expected result and adjusts the weights to reduce the error.<\/p>\n\n\n\n<p><strong>What is an artificial neural network (ANN)?<\/strong><br>An ANN is a machine learning model built from connected artificial neurons, loosely inspired by the brain, that learns patterns from data by adjusting its weights.<\/p>\n\n\n\n<p><strong>What is gradient descent in simple terms?<\/strong><br>Gradient descent is a method for finding the lowest error. Like a rover feeling its way to the bottom of a pond, it takes repeated small steps in the direction that reduces the cost function.<\/p>\n\n\n\n<p><strong>What is the difference between a loss function and a cost function?<\/strong><br>A loss function measures the error for a single training example. A cost function averages or sums those losses across the entire training set.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In machine learning, an algorithm is only as good as the data it was trained on. Learning from experience is the whole point. Without machine learning, we would have to manually program a huge number of &#8220;if&#8221; and &#8220;if-else&#8221; conditions just to help a computer tell a car from a human being. Neural networks are [&hellip;]<\/p>\n","protected":false},"author":100,"featured_media":1756,"comment_status":"open","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"footnotes":""},"categories":[73,32],"tags":[],"class_list":["post-1749","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","category-technology"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How Neural Networks Work: ANNs, Loss &amp; Gradient Descent<\/title>\n<meta name=\"description\" content=\"Learn how neural networks work. What an artificial neural network (ANN) is, loss function vs cost function, and gradient descent explained simply.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/nuventure.com\/blog\/2021\/12\/29\/neural-networks-explained-how-they-work\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How Neural Networks Work: ANNs, Loss &amp; Gradient Descent\" \/>\n<meta property=\"og:description\" content=\"Learn how neural networks work. What an artificial neural network (ANN) is, loss function vs cost function, and gradient descent explained simply.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nuventure.com\/blog\/2021\/12\/29\/neural-networks-explained-how-they-work\/\" \/>\n<meta property=\"og:site_name\" content=\"Nuventure Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/nuventureco\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-29T06:31:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-28T07:00:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/nuventure.com\/blog\/wp-content\/uploads\/2021\/12\/Intro-to-neural-network.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Steve\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@nuventureco\" \/>\n<meta name=\"twitter:site\" content=\"@nuventureco\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Steve\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/2021\\\/12\\\/29\\\/neural-networks-explained-how-they-work\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/2021\\\/12\\\/29\\\/neural-networks-explained-how-they-work\\\/\"},\"author\":{\"name\":\"Steve\",\"@id\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/#\\\/schema\\\/person\\\/e42795dd493946ecd146143ac76ff1a6\"},\"headline\":\"How Neural Networks Work: Artificial Neural Networks Explained\",\"datePublished\":\"2021-12-29T06:31:18+00:00\",\"dateModified\":\"2026-10-28T07:00:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/2021\\\/12\\\/29\\\/neural-networks-explained-how-they-work\\\/\"},\"wordCount\":2433,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/2021\\\/12\\\/29\\\/neural-networks-explained-how-they-work\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/Intro-to-neural-network.png\",\"articleSection\":[\"AI\",\"Technology\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/nuventure.com\\\/blog\\\/2021\\\/12\\\/29\\\/neural-networks-explained-how-they-work\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/2021\\\/12\\\/29\\\/neural-networks-explained-how-they-work\\\/\",\"url\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/2021\\\/12\\\/29\\\/neural-networks-explained-how-they-work\\\/\",\"name\":\"How Neural Networks Work: ANNs, Loss & Gradient Descent\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/2021\\\/12\\\/29\\\/neural-networks-explained-how-they-work\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/2021\\\/12\\\/29\\\/neural-networks-explained-how-they-work\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/Intro-to-neural-network.png\",\"datePublished\":\"2021-12-29T06:31:18+00:00\",\"dateModified\":\"2026-10-28T07:00:16+00:00\",\"description\":\"Learn how neural networks work. What an artificial neural network (ANN) is, loss function vs cost function, and gradient descent explained simply.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/2021\\\/12\\\/29\\\/neural-networks-explained-how-they-work\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/nuventure.com\\\/blog\\\/2021\\\/12\\\/29\\\/neural-networks-explained-how-they-work\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/2021\\\/12\\\/29\\\/neural-networks-explained-how-they-work\\\/#primaryimage\",\"url\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/Intro-to-neural-network.png\",\"contentUrl\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/Intro-to-neural-network.png\",\"width\":1200,\"height\":675,\"caption\":\"Neural Networks Explained | How Artificial Neural Networks Work\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/2021\\\/12\\\/29\\\/neural-networks-explained-how-they-work\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How Neural Networks Work: Artificial Neural Networks Explained\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/\",\"name\":\"Nuventure Blog\",\"description\":\"Knowledge.transmit!\",\"publisher\":{\"@id\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/#organization\",\"name\":\"Nuventure Connect Private Limited\",\"url\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/logo-main-with-cartion-1.webp\",\"contentUrl\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/logo-main-with-cartion-1.webp\",\"width\":200,\"height\":89,\"caption\":\"Nuventure Connect Private Limited\"},\"image\":{\"@id\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/nuventureco\\\/\",\"https:\\\/\\\/x.com\\\/nuventureco\",\"https:\\\/\\\/www.instagram.com\\\/nuventure\\\/\",\"https:\\\/\\\/in.linkedin.com\\\/company\\\/nuventure\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/#\\\/schema\\\/person\\\/e42795dd493946ecd146143ac76ff1a6\",\"name\":\"Steve\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6f3e173bfb43df2379a3d1e13f45dac45833f41517df324e85f62651382b2c07?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6f3e173bfb43df2379a3d1e13f45dac45833f41517df324e85f62651382b2c07?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6f3e173bfb43df2379a3d1e13f45dac45833f41517df324e85f62651382b2c07?s=96&r=g\",\"caption\":\"Steve\"},\"url\":\"https:\\\/\\\/nuventure.com\\\/blog\\\/author\\\/steve\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How Neural Networks Work: ANNs, Loss & Gradient Descent","description":"Learn how neural networks work. What an artificial neural network (ANN) is, loss function vs cost function, and gradient descent explained simply.","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:\/\/nuventure.com\/blog\/2021\/12\/29\/neural-networks-explained-how-they-work\/","og_locale":"en_US","og_type":"article","og_title":"How Neural Networks Work: ANNs, Loss & Gradient Descent","og_description":"Learn how neural networks work. What an artificial neural network (ANN) is, loss function vs cost function, and gradient descent explained simply.","og_url":"https:\/\/nuventure.com\/blog\/2021\/12\/29\/neural-networks-explained-how-they-work\/","og_site_name":"Nuventure Blog","article_publisher":"https:\/\/www.facebook.com\/nuventureco\/","article_published_time":"2021-12-29T06:31:18+00:00","article_modified_time":"2026-10-28T07:00:16+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/nuventure.com\/blog\/wp-content\/uploads\/2021\/12\/Intro-to-neural-network.png","type":"image\/png"}],"author":"Steve","twitter_card":"summary_large_image","twitter_creator":"@nuventureco","twitter_site":"@nuventureco","twitter_misc":{"Written by":"Steve","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/nuventure.com\/blog\/2021\/12\/29\/neural-networks-explained-how-they-work\/#article","isPartOf":{"@id":"https:\/\/nuventure.com\/blog\/2021\/12\/29\/neural-networks-explained-how-they-work\/"},"author":{"name":"Steve","@id":"https:\/\/nuventure.com\/blog\/#\/schema\/person\/e42795dd493946ecd146143ac76ff1a6"},"headline":"How Neural Networks Work: Artificial Neural Networks Explained","datePublished":"2021-12-29T06:31:18+00:00","dateModified":"2026-10-28T07:00:16+00:00","mainEntityOfPage":{"@id":"https:\/\/nuventure.com\/blog\/2021\/12\/29\/neural-networks-explained-how-they-work\/"},"wordCount":2433,"commentCount":0,"publisher":{"@id":"https:\/\/nuventure.com\/blog\/#organization"},"image":{"@id":"https:\/\/nuventure.com\/blog\/2021\/12\/29\/neural-networks-explained-how-they-work\/#primaryimage"},"thumbnailUrl":"https:\/\/nuventure.com\/blog\/wp-content\/uploads\/2021\/12\/Intro-to-neural-network.png","articleSection":["AI","Technology"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/nuventure.com\/blog\/2021\/12\/29\/neural-networks-explained-how-they-work\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/nuventure.com\/blog\/2021\/12\/29\/neural-networks-explained-how-they-work\/","url":"https:\/\/nuventure.com\/blog\/2021\/12\/29\/neural-networks-explained-how-they-work\/","name":"How Neural Networks Work: ANNs, Loss & Gradient Descent","isPartOf":{"@id":"https:\/\/nuventure.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/nuventure.com\/blog\/2021\/12\/29\/neural-networks-explained-how-they-work\/#primaryimage"},"image":{"@id":"https:\/\/nuventure.com\/blog\/2021\/12\/29\/neural-networks-explained-how-they-work\/#primaryimage"},"thumbnailUrl":"https:\/\/nuventure.com\/blog\/wp-content\/uploads\/2021\/12\/Intro-to-neural-network.png","datePublished":"2021-12-29T06:31:18+00:00","dateModified":"2026-10-28T07:00:16+00:00","description":"Learn how neural networks work. What an artificial neural network (ANN) is, loss function vs cost function, and gradient descent explained simply.","breadcrumb":{"@id":"https:\/\/nuventure.com\/blog\/2021\/12\/29\/neural-networks-explained-how-they-work\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nuventure.com\/blog\/2021\/12\/29\/neural-networks-explained-how-they-work\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nuventure.com\/blog\/2021\/12\/29\/neural-networks-explained-how-they-work\/#primaryimage","url":"https:\/\/nuventure.com\/blog\/wp-content\/uploads\/2021\/12\/Intro-to-neural-network.png","contentUrl":"https:\/\/nuventure.com\/blog\/wp-content\/uploads\/2021\/12\/Intro-to-neural-network.png","width":1200,"height":675,"caption":"Neural Networks Explained | How Artificial Neural Networks Work"},{"@type":"BreadcrumbList","@id":"https:\/\/nuventure.com\/blog\/2021\/12\/29\/neural-networks-explained-how-they-work\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/nuventure.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How Neural Networks Work: Artificial Neural Networks Explained"}]},{"@type":"WebSite","@id":"https:\/\/nuventure.com\/blog\/#website","url":"https:\/\/nuventure.com\/blog\/","name":"Nuventure Blog","description":"Knowledge.transmit!","publisher":{"@id":"https:\/\/nuventure.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/nuventure.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/nuventure.com\/blog\/#organization","name":"Nuventure Connect Private Limited","url":"https:\/\/nuventure.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nuventure.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/nuventure.com\/blog\/wp-content\/uploads\/2023\/03\/logo-main-with-cartion-1.webp","contentUrl":"https:\/\/nuventure.com\/blog\/wp-content\/uploads\/2023\/03\/logo-main-with-cartion-1.webp","width":200,"height":89,"caption":"Nuventure Connect Private Limited"},"image":{"@id":"https:\/\/nuventure.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/nuventureco\/","https:\/\/x.com\/nuventureco","https:\/\/www.instagram.com\/nuventure\/","https:\/\/in.linkedin.com\/company\/nuventure"]},{"@type":"Person","@id":"https:\/\/nuventure.com\/blog\/#\/schema\/person\/e42795dd493946ecd146143ac76ff1a6","name":"Steve","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/6f3e173bfb43df2379a3d1e13f45dac45833f41517df324e85f62651382b2c07?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/6f3e173bfb43df2379a3d1e13f45dac45833f41517df324e85f62651382b2c07?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6f3e173bfb43df2379a3d1e13f45dac45833f41517df324e85f62651382b2c07?s=96&r=g","caption":"Steve"},"url":"https:\/\/nuventure.com\/blog\/author\/steve\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/nuventure.com\/blog\/wp-json\/wp\/v2\/posts\/1749","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nuventure.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nuventure.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nuventure.com\/blog\/wp-json\/wp\/v2\/users\/100"}],"replies":[{"embeddable":true,"href":"https:\/\/nuventure.com\/blog\/wp-json\/wp\/v2\/comments?post=1749"}],"version-history":[{"count":10,"href":"https:\/\/nuventure.com\/blog\/wp-json\/wp\/v2\/posts\/1749\/revisions"}],"predecessor-version":[{"id":3613,"href":"https:\/\/nuventure.com\/blog\/wp-json\/wp\/v2\/posts\/1749\/revisions\/3613"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nuventure.com\/blog\/wp-json\/wp\/v2\/media\/1756"}],"wp:attachment":[{"href":"https:\/\/nuventure.com\/blog\/wp-json\/wp\/v2\/media?parent=1749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nuventure.com\/blog\/wp-json\/wp\/v2\/categories?post=1749"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nuventure.com\/blog\/wp-json\/wp\/v2\/tags?post=1749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}