Lesson 9 of 15
Network Forward Pass
Composing Layers
A neural network is a sequence of layers. The forward pass is just function composition:
Where each is either a DenseLayer or an ActivationLayer.
Activation Layers
An ActivationLayer simply applies a scalar function element-wise to its input:
Network Architecture
A typical two-hidden-layer network looks like:
Input → Dense(n, 64) → ReLU → Dense(64, 32) → ReLU → Dense(32, 1) → Sigmoid
Each Dense layer mixes features. Each Activation layer introduces non-linearity.
Your Task
Implement:
ActivationLayer(activation)with aforward(inputs)method that appliesactivationelement-wiseNetwork(layers)with aforward(inputs)method that passes data through each layer in sequence
Python runtime loading...
Loading...
Click "Run" to execute your code.