Deep learning is a branch of machine learning that uses neural networks with many layers to learn complex patterns from data. It powers many modern AI systems such as image recognition, language translation, and game-playing models.
At the core of deep learning are neural networks, which are built from simple components called neurons.
The Linear Unit (Neuron)
A single neuron:
- Takes input values
- Multiplies them by weights
- Adds a bias
- Produces an output
Mathematically:
y = w * x + b
This is just a linear equation, meaning a single neuron acts as a linear model. The network learns by adjusting the weights and bias.
Multiple Inputs
Neurons can accept multiple inputs (features). Each input has its own weight, and all weighted inputs are summed with a bias:
y = w₀x₀ + w₁x₁ + w₂x₂ + b
This allows models to learn from real-world datasets with many features.
Linear Models in Keras
Using Keras, we can create a simple linear model with a single neuron:
from tensorflow import keras
from tensorflow.keras import layers
model = keras.Sequential([
layers.Dense(units=1, input_shape=[3])
])
- units=1 → one output
- input_shape=[3] → three input features
Key Takeaways
Deep learning uses stacked neural networks
A neuron performs a simple linear computation
Weights and bias are learned from data
Keras makes building neural networks easy
Top comments (0)