# two-layer artificial neural network

> type of artificial neural network

**Wikidata**: [Q110509808](https://www.wikidata.org/wiki/Q110509808)  
**Source**: https://4ort.xyz/entity/two-layer-artificial-neural-network

## Summary
A two-layer artificial neural network is a type of artificial neural network that consists of an input layer, one hidden layer, and an output layer. It is a fundamental architecture in machine learning used for pattern recognition and function approximation.

## Key Facts
- Subclass of: artificial neural network
- Contains: one hidden layer between input and output layers
- Used for: pattern recognition, function approximation, and supervised learning tasks
- Training method: typically uses backpropagation algorithm
- Activation functions: commonly uses sigmoid, ReLU, or tanh in hidden layer

### Q: What is the difference between a two-layer and single-layer neural network?
A: A two-layer neural network includes one hidden layer between the input and output layers, while a single-layer network (perceptron) connects inputs directly to outputs without hidden layers, limiting its ability to learn complex patterns.

### Q: What are common applications of two-layer neural networks?
A: Two-layer neural networks are commonly used for classification tasks, regression problems, and function approximation in areas like image recognition, speech processing, and financial forecasting.

### Q: How is a two-layer neural network trained?
A: Two-layer neural networks are typically trained using the backpropagation algorithm, which calculates gradients of the error with respect to weights and adjusts them through gradient descent to minimize prediction error.

## Why It Matters
Two-layer artificial neural networks represent a critical advancement in machine learning architecture, bridging the gap between simple perceptrons and deeper networks. They can learn non-linear decision boundaries and approximate complex functions that single-layer networks cannot handle. This architecture enabled significant breakthroughs in pattern recognition and remains a foundational building block for understanding more complex neural network designs. Two-layer networks demonstrate the power of hidden layers in feature learning and continue to be valuable for problems where deeper architectures might be unnecessary or computationally expensive.

## Notable For
- First architecture capable of learning non-linear decision boundaries
- Foundation for understanding backpropagation and gradient-based learning
- Balance between computational efficiency and representational power
- Widely used in educational contexts to teach neural network concepts
- Benchmark architecture for comparing more complex network designs

## Body
Two-layer artificial neural networks consist of three layers: input layer, hidden layer, and output layer. The hidden layer contains neurons that transform input data through weighted connections and activation functions. During forward propagation, input signals pass through the network, with each neuron computing a weighted sum of its inputs plus a bias term, then applying an activation function. The backpropagation algorithm trains these networks by computing gradients of the loss function with respect to each weight through the chain rule, then updating weights using optimization algorithms like stochastic gradient descent. Common activation functions include sigmoid (σ(x) = 1/(1+e^(-x))), hyperbolic tangent (tanh(x)), and ReLU (max(0,x)). The universal approximation theorem states that a two-layer network with sufficient hidden units can approximate any continuous function on compact subsets of R^n, making it theoretically powerful despite its simplicity. Training involves forward pass to compute predictions, loss calculation, backward pass to compute gradients, and weight updates. Two-layer networks typically use mean squared error for regression tasks and cross-entropy loss for classification tasks.

## Schema Markup
```json
{
  "@context": "https://schema.org",
  "@type": "Thing",
  "name": "two-layer artificial neural network",
  "description": "A type of artificial neural network consisting of an input layer, one hidden layer, and an output layer",
  "additionalType": "artificial neural network"
}