Skip to content
Reviewed by Vikas Mittal Nov 05, 2026

Home › Guides › What is a neural network

Tech Explained · 2026

What Is a Neural Network? How It Works, a Worked Example and When Not to Use One in 2026

A neural network is a stack of simple numeric functions that learns from examples. Each artificial neuron multiplies its inputs by weights, adds a bias and pushes the result through an activation function. Training nudges those weights down the error gradient. The example worked by hand below runs on just nine numbers.

5 November 202610 min readBy the 360 Digital Transformation Editorial Team
Key takeaways
  • A neuron is three operations. Multiply by weights, add a bias, squash. The rest is repetition.
  • The parameter count is arithmetic you can do. A 30 to 32 to 16 to 1 network holds exactly 1,537 weights and biases.
  • Learning is one subtraction. Each weight moves against its gradient. One step by hand drops the loss from 0.7677 to 0.6239.
  • On small tabular data a network usually loses. In the run measured here, logistic regression scored 98.6 percent in 3 ms against the network's 96.5 percent in 216 ms.
  • Most production work is consuming networks, not training them. No GPU needed: everything below runs on a laptop CPU.

Your first network trains in two seconds and scores 96.5 percent. Then someone fits a logistic regression in 3 milliseconds and it scores 98.6. That happened while this guide was being written, on a public dataset, with the code printed below. Knowing why is most of what separates having heard of neural networks from being able to use one.

What Is a Neural Network Made Of? Neurons, Weights and Layers

An artificial neuron does three things. It multiplies each input by a weight, adds one bias, and passes that single number through an activation function. With inputs x1 and x2 it computes z = w1·x1 + w2·x2 + b, then outputs f(z). That is the entire unit. No memory, no logic, no rules.

Neurons side by side make a layer. Layers front to back make a network: an input layer the width of your features, hidden layers you choose, and an output layer the width of your answer.

The activation function is the part people skip and the part that matters. Without it a 50 layer network collapses into one matrix multiplication, because a linear function of a linear function is still linear. ReLU, the library default, is just max(0, z), and that single kink is what lets the stack bend.

How Do Neural Networks Work in Plain Terms

Training is a loop: predict, score the error with a loss function, work backwards to find each weight's share of it, then subtract a small fraction of every gradient. That backward step is backpropagation, and the next section runs one by hand.

Because every layer is only weights and biases, you can count the parameters before training anything. A layer with n inputs and m outputs holds n×m weights plus m biases. The network used later here, 30 features to 32 to 16 to 1 output, holds (30×32 + 32) + (32×16 + 16) + (16×1 + 1) = 992 + 528 + 17 = 1,537 parameters. When the run below reports 1,537, it is reporting that sum.

The 2 to 2 to 1 network worked by hand in the next section

Every arrow is a weight, every box holds a bias: nine numbers in total.

A small neural network with two inputs, two ReLU hidden units and one sigmoid output Inputs 0.60 and 0.80 feed two hidden units through four labelled weights. The hidden outputs 0.08 and 0.90 feed a sigmoid output unit through two more weights, producing 0.46. Input layer Hidden layer (ReLU) Output (sigmoid) x1 = 0.60 x2 = 0.80 h1 = ReLU(z) b = 0.10, out 0.08 h2 = ReLU(z) b = -0.20, out 0.90 sigmoid(z) b = 0.30, z = -0.144 prediction 0.46 w 0.50 w 0.90 w -0.40 w 0.70 w 1.20 w -0.60 6 weights on the arrows plus 3 biases in the boxes = 9 trainable numbers

Values computed with numpy and printed below, checked 5 November 2026.

What Is a Neural Network Actually Learning? A Worked Forward Pass and One Gradient Step

The whole model, as nine numbers. Hidden unit one: weights 0.50 and -0.40, bias 0.10. Hidden unit two: weights 0.90 and 0.70, bias -0.20. Output unit: weights 1.20 and -0.60, bias 0.30. Feed it one example, x1 = 0.60 and x2 = 0.80, true label 1.

The neural network example in Python below prints every number that follows. Hidden unit one: 0.50×0.60 + (-0.40)×0.80 + 0.10 = 0.08, which ReLU leaves alone. Hidden unit two: 0.90×0.60 + 0.70×0.80 - 0.20 = 0.90, also unchanged. Output: 1.20×0.08 + (-0.60)×0.90 + 0.30 = -0.144. Sigmoid turns that into 1 / (1 + e^0.144) = 0.4641, and binary cross entropy against a label of 1 is -ln(0.4641) = 0.7677.

The model predicted 0.46 where it should sit close to 1. It is wrong, so it has to move.

A Neural Network Example in Python You Can Run in 30 Seconds

import numpy as np
x  = np.array([0.60, 0.80])
W1 = np.array([[0.5, -0.4], [0.9, 0.7]])   # one row per hidden unit
b1 = np.array([0.1, -0.2])
W2 = np.array([1.2, -0.6]); b2 = 0.3

z1 = W1 @ x + b1          # [ 0.08  0.90]
a1 = np.maximum(0, z1)    # ReLU
z2 = W2 @ a1 + b2         # -0.144
yhat = 1 / (1 + np.exp(-z2))
print(round(float(yhat), 4), round(float(-np.log(yhat)), 4))
# 0.4641 0.7677

Now the backward pass. For a sigmoid output with binary cross entropy loss, the gradient at the output is prediction minus label: 0.4641 - 1 = -0.5359. That clean result is why the pairing is the binary-classification default. Each output weight's gradient is that number times the activation it fed from, so -0.0429 and -0.4823.

Multiply by a learning rate of 0.1 and subtract. The output weights move to 1.2043 and -0.5518. Push the signal back through ReLU, update the hidden weights, run forward again, and the prediction rises to 0.5359 while the loss falls to 0.6239. One step, measurably less wrong.

y, lr = 1.0, 0.1
d2  = yhat - y                  # -0.5359
gW2, gb2 = d2 * a1, d2
d1  = (W2 * d2) * (z1 > 0)      # back through ReLU
gW1, gb1 = np.outer(d1, x), d1
W2, b2 = W2 - lr * gW2, b2 - lr * gb2
W1, b1 = W1 - lr * gW1, b1 - lr * gb1
# re-run the forward pass: yhat 0.5359, loss 0.6239

That is the complete algorithm. A production network has billions of parameters instead of nine and runs this loop on a GPU for weeks. Nothing else is added.

The two networks in this guide, by the numbers

Both train on a laptop CPU in under a second.

9
Weights and biases in the hand-worked network
1,537
Parameters in the 30 to 32 to 16 to 1 network
321
Adam iterations it ran before converging
216 ms
Fit time, best of three runs on one CPU

Measured with scikit-learn 1.9.1 and numpy 2.5.3 on 5 November 2026; timings differ by machine.

Neural Network vs Machine Learning: Where the Line Actually Is

People type neural network vs machine learning into Google a thousand times a day, and the phrasing itself is the problem: a neural network is machine learning. It is one family inside the field, alongside linear models and tree ensembles. The comparison worth making is networks against those families, because that is the Monday morning choice.

Criterion Neural network Linear model or tree ensemble
Data it is built for Images, audio, text, anything structured in space or sequence Rows and columns, mixed types, missing values
Rows you want Tens of thousands upwards Useful from a few hundred rows
Explaining a prediction Hard, needs SHAP after the fact Coefficients or split paths you can read
Training cost Seconds to weeks, often needs a GPU Milliseconds to minutes on a laptop
Where it clearly wins Perception, language, generation, embeddings Tabular prediction, forecasting, risk scoring
Typical tool in 2026 PyTorch, Keras, or a hosted model you call scikit-learn, XGBoost, LightGBM

This is not a matter of taste. Grinsztajn, Oyallon and Varoquaux's NeurIPS 2022 benchmark compared tuned deep learning models against tree ensembles across 45 datasets and found tree-based models still ahead on tabular data of roughly 10,000 rows, before counting their speed advantage. Most teams still treat gradient boosting as the tabular default.

The run below is the small version of that finding: one public dataset, 569 rows, 30 numeric features, a 25 percent test split on a fixed seed, five models, best of three fit times.

from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.pipeline import make_pipeline
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import HistGradientBoostingClassifier
from sklearn.neural_network import MLPClassifier

X, y = load_breast_cancer(return_X_y=True)
Xtr, Xte, ytr, yte = train_test_split(X, y, test_size=0.25,
                                      random_state=42, stratify=y)
nn = make_pipeline(StandardScaler(),
                   MLPClassifier(hidden_layer_sizes=(32, 16),
                                 max_iter=800, random_state=42))
nn.fit(Xtr, ytr)
print(nn.score(Xte, yte))   # 0.965

Fit time and test accuracy on 569 rows of tabular data

The slowest model is not the most accurate one, and the fastest is.

Logistic regressionno tuning
3 ms98.6% accurate
Random forestdefaults
94 ms95.8% accurate
Gradient boostingdefaults
124 ms97.2% accurate
Neural net 32, 161,537 params
216 ms96.5% accurate
Neural net 128, 6412,289 params
245 ms96.5% accurate

Best of three runs per model on one CPU, scikit-learn 1.9.1, seed 42, measured 5 November 2026.

Note the last two rows. Eight times the parameters bought zero accuracy. On data like this capacity is not the constraint, so a bigger network is only a slower route to the same answer.

Here is the opinion, and it costs us something to say it on a page selling AI training. If your problem arrives as a spreadsheet, don't start with a neural network. Fit a logistic regression in ten minutes, gradient boosting in the next twenty, and reach for a network only if those leave real money on the table. The trade-off is a ceiling: you give up the chance a network spots an interaction the trees missed, and on tabular data that chance is small. That baseline-first habit is the ground covered in 360DT's live Data Analyst course.

A network is the only answer for anything that is not a table: pixels, waveforms, sentences, and the embeddings behind semantic search. No gradient boosting model reads a claim document.

Also read: How Do Large Language Models Work? Tokens, Embeddings and Attention Explained, which picks up exactly where this guide stops.

Types of Neural Networks You Will Actually Meet in a Job

Textbooks list twenty types of neural networks. Four cover almost everything you will touch in an Indian product or services team; the fifth is worth recognising in a job description.

Type What it takes as input Where you meet it Do you train it yourself?
MLP, the dense network A fixed-length vector of numbers Baselines, the final layers of bigger models Yes, and it is the one to learn first
CNN, convolutional Images, spectrograms, any grid Defect detection, document scans, medical imaging Usually fine-tuned from a pretrained backbone
RNN and LSTM Ordered sequences Older forecasting and speech systems still in production Rarely new, mostly maintained
Transformer Sequences of tokens, and now images too Every LLM, every embedding model, most new vision work Almost never from scratch, you call it or fine-tune it
GNN, graph Nodes and edges Fraud rings, recommendation, supply chain networks Yes, in specialist teams

The honest picture of 2026 is that most neural network work in industry is consumption, not construction. You call a hosted transformer, fine-tune a vision backbone, store embeddings in a vector index. Training a large model from zero is a capital expense, not a project. Which is why the hired skills are retrieval, evaluation, tool use and deployment, the spine of 360DT's live AI Engineer course.

If you do want to write the training loop, PyTorch is the default and it moves fast: version 2.15.0 reached general availability on 28 October 2026 according to the PyTorch dev-discuss release announcement, paired with TorchVision 0.29.2. Pin your versions or the notebook breaks on someone else's machine.

Where You Will Meet Neural Networks in Real Work

Picture a two-person analytics team at a mid-size insurer in Pune with 40,000 policy records and one question: which customers are about to lapse? That is the commonest shape of real work and it is tabular. Their first move is gradient boosting with a clean validation split. Three weeks on a deep model lands them roughly where a Tuesday afternoon with scikit-learn would have.

The same team gets a second question. Claims arrive as scanned PDFs and someone wants the policy number and claimed amount pulled out automatically. No tabular answer exists here. This needs a vision model, which in practice means calling a pretrained one rather than training a CNN. Microsoft-stack teams reach for Azure AI services, the territory of the AI-200 Azure AI Cloud Developer track; AWS teams wire it into existing infrastructure, the integration work practised in the AWS Solutions Architect and DevOps course.

The third place is the one people notice least. Every time text becomes a vector for semantic search, a transformer ran, and nobody on the team trained it. Keeping those models alive with monitoring, retraining triggers and rollback is a job title of its own: that work maps to the AI-300 objectives taught live in 360DT's MLOps Engineer course, while the pipelines feeding it belong to a Microsoft Fabric data engineering program.

Also read: Machine Learning Projects for Beginners 2026 for six builds that start from the baseline-first habit described above.

What Usually Goes Wrong in a First Neural Network Project

Here is the conversation you will have with a colleague at some point. Your network predicts the same class for every row, the loss chart is flat, and you are about to add another hidden layer. Don't. Nine times out of ten it is the scaling: one column measured in lakhs next to another measured in 0 to 1 dominates every gradient until you standardise.

Four failures that look like model problems
  • Unscaled features. Symptom: the loss sits flat from epoch one. Cause: one column's magnitude swamps the gradients. Fix: put StandardScaler in a pipeline.
  • Scaler fitted before the split. Symptom: validation accuracy nobody reproduces in production. Cause: test-set statistics leaked into training. Fix: fit the pipeline, not the scaler, inside the split.
  • Ignoring the convergence warning. scikit-learn's MLPClassifier defaults to max_iter=200, solver='adam' and learning_rate_init=0.001. Hit that ceiling and it stops mid-training with a warning. The network here needed 321 iterations, so at the default it would score worse than it should.
  • No baseline. Symptom: a 96 percent accuracy you cannot defend. Fix: fit a logistic regression first and write its score at the top of the notebook.

One more, less technical. If 2 percent of policies lapse, a model predicting "no lapse" for everyone scores 98 percent accuracy and is worth nothing. Read precision, recall and the confusion matrix, not accuracy.

How to Learn Neural Networks Properly in 2026

The sequence that works is short. Write the nine-number network above by hand until the forward pass holds no mystery. Reproduce it in numpy including the gradient step, because typing it is what stops backpropagation being a word. Spend a week on scikit-learn and tabular baselines. Only then open PyTorch, and open it to fine-tune something pretrained. A laptop CPU covers the first three stages; free hosted notebooks cover the fourth, though Google's own Colab FAQ is explicit that its resources are neither guaranteed nor unlimited.

Once you know how neural networks work at the level of the arithmetic above, the rest is tooling. Skip the derivative-heavy maths course at first. You will pick up the chain rule faster once you have watched gradients move real numbers. Do not skip evaluation: being able to say why a score is trustworthy is rarer and better paid than being able to produce one.

To see it taught live before paying for anything, the free webinars cover this ground in one session, the full certifications overview shows where the material sits inside the Microsoft and Claude paths, and a free demo class tells you whether a weekend format suits you.

In your position I would do this. Spend a weekend on the two code blocks above until you can predict their output before running them, then take one tabular dataset you care about and beat a logistic regression on it. That exercise teaches more than a month of lectures. For the production half, retrieval, agents, evaluation and deployment, the live cohort below is what it is built for.

Live course

From understanding a neural network to shipping systems that use one

Live online·Sat–Sun, 8–11 PM IST·100+ hrs·Rs 24,999

The AI Engineer course teaches you to build agents that plan, use tools and act, certified on both Microsoft Copilot Studio and Claude Code. Sixteen weeks of live weekend sessions covering generative AI, RAG and AI agents.

Explore the course
AI Engineer Course: Generative AI, RAG & AI Agents (Microsoft + Claude Certified)

Frequently asked questions

What is a neural network in simple words?

It is a chain of small calculators. Each multiplies its inputs by weights, adds a bias, squashes the result and passes it on. Learning means adjusting those weights until the final number sits closer to the right answer.

How do neural networks learn from data?

By gradient descent. The network predicts, a loss function scores how wrong it was, backpropagation finds each weight's share of that error, and every weight steps against its gradient. One such step above cut the loss from 0.7677 to 0.6239.

Is a neural network the same as machine learning?

No. Machine learning is the field; neural networks are one family inside it, alongside linear models and tree ensembles like XGBoost. Deep learning means networks with many hidden layers. Most machine learning in production is not a neural network.

How many hidden layers does a neural network need?

For tabular data, one or two, and more usually just costs time. The run measured here went from 1,537 parameters to 12,289 and gained nothing. Depth earns its keep on images, audio and language.

Do I need a GPU to learn neural networks?

Not to learn. Everything here ran on one CPU in under a second per model with scikit-learn 1.9.1 and numpy. A GPU matters once you fine-tune pretrained vision or language models, and free notebooks ration that access.

How much data do you need to train a neural network?

No fixed threshold, but below roughly ten thousand rows of tabular data a network rarely beats gradient boosting. The NeurIPS 2022 benchmark found tree ensembles still ahead across 45 datasets at that size. Fine-tuning needs far less.

Which library should a beginner use for neural networks?

Start with numpy to write the forward and backward pass yourself, then scikit-learn's MLPClassifier for quick experiments, then PyTorch for custom architectures or a GPU. PyTorch 2.15.0 became generally available on 28 October 2026, so pin your version.

Why did a simpler model beat the neural network in this guide?

Because the dataset is small, tabular and close to linearly separable, which is where a linear model shines. Logistic regression scored 98.6 percent in 3 milliseconds against the network's 96.5 percent in 216 milliseconds.

About this guide. 360 Digital Transformation is an Anthropic Partner and a Microsoft Authorized Training Partner. Other certification bodies, vendors and employers named here are not affiliated with us. Tools and versions change quickly; commands and figures cited were checked on 5 November 2026.

Learn it live with 360 Digital Transformation

Turn this guide into a skill employers can see

Live weekend cohortEMI available

AI Engineer Course: Generative AI, RAG & AI Agents (Microsoft + Claude Certified)

Rs. 27,999Rs. 37,239 Save 24%

Tools and platforms you work with

  • Python
  • Claude API
  • FAISS
  • ChromaDB
  • LangChain
  • LangGraph
  • CrewAI
  • AutoGen (AG2)
Add bonus modules
See the syllabus and batch dates

Other live courses on this career path