Skip to content
tezvyn:

Artificial Neural Networks: Learning from Examples

Source: Wikipedia: Artificial Neural NetworkEasyHow cards are made

Artificial Neural Networks: Learning from Examples

Think of an ANN as a digital brain that learns from examples, not explicit code. It's a network of simple nodes that adjust their connections to spot patterns. They power image recognition and language translation, but are only as good as their training data.

Why it exists

Artificial Neural Networks (ANNs) were created to solve problems where the rules are too complex or unknown to be programmed explicitly. For example, writing code with if-then statements to identify a cat in a photo is practically impossible. ANNs solve this by learning the patterns directly from a large dataset of example images.

The mental model

Think of an ANN as a team of thousands of simple calculators, called neurons, organized into layers. The input layer receives raw data, like the pixels of an image. This data is passed through one or more "hidden" layers, where each neuron performs a simple calculation and passes its result forward. The final "output" layer provides the answer, like the probability of the image being a "cat". The learning happens during a "training" phase, where the network adjusts the connections between neurons to get better at producing the right answer.

How it works

An ANN consists of nodes in layers: an input layer, hidden layers, and an output layer. Each connection between neurons has a "weight," a number that controls the influence of one neuron on another. When data enters the input layer, each neuron multiplies its inputs by their weights, sums them up, and uses an "activation function" to determine its output signal. This signal is then passed to the next layer. During training, the network compares its output to the correct answer. If it's wrong, an algorithm called backpropagation works backward through the network, slightly adjusting the weights to reduce the error. This process is repeated millions of times with many examples until the network's predictions are accurate.

When to use it

Use ANNs for complex pattern recognition problems where you have large amounts of labeled data. Three key areas are: first, computer vision for tasks like image classification; second, natural language processing for sentiment analysis or machine translation; and third, time-series forecasting for predicting stock prices or energy demand.

When not to use it

Avoid ANNs for simple problems solvable with traditional algorithms, like sorting a list or calculating a payroll. They require significant data and computational power for training. They are also often "black boxes," making it hard to interpret why a specific decision was made, which is a major drawback in fields requiring explainability like finance or medicine.

One canonical example

A classic example is handwritten digit recognition using the MNIST dataset. An ANN takes a 28x28 pixel image of a digit as input (784 input neurons). The data passes through hidden layers that learn to recognize primitive features like lines, curves, and loops. The output layer consists of 10 neurons, one for each digit from 0 to 9. After training on thousands of examples, the network can accurately classify new, unseen handwritten digits.

Interview question

How do Artificial Neural Networks primarily learn to perform complex tasks like image recognition?

  • a.Through explicit programming of if-then rules for pattern identification.
  • b.By comparing new inputs against a pre-existing, comprehensive database of known patterns.
  • c.By adjusting the strength of connections between its internal nodes based on example data.Correct
  • d.By dynamically adding or removing layers and neurons during the recognition process.
Why?

The card explains that ANNs learn by adjusting the 'weights' of connections between neurons during a 'training' phase, using algorithms like backpropagation to reduce errors based on example data. Explicit programming (Option A) is what ANNs aim to avoid, as their purpose is to learn complex rules from data rather than having them explicitly coded.

Just read this? Test yourself on what you have been reading.

Read the original → en.wikipedia.org

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on machine learning — each one lists the topics its interview covers.

See open roles