← Back to quizzesFree quiz

Fundamentals of Artificial Neural Networks

Artificial Neural Networks (ANNs) are the backbone of modern Artificial Intelligence and Machine Learning . This course breaks down the core concepts tested in a typical quiz, providing…

10 questions~5 min
Fundamentals of Artificial Neural Networks — Qwi
0 / 10
Score: 0%
1

What is the main limitation of a single-layer perceptron compared to deep neural networks?

2

During forward propagation in a multilayer network, how is the activation of layer k computed?

3

Which of the following statements best describes the universal approximation theorem for multilayer perceptrons?

4

In the gradient of the quadratic error for a perceptron, which term must be stored during forward propagation to be reused in back‑propagation?

5

When using the binary cross‑entropy loss for a perceptron with sigmoid activation, which expression gives the gradient with respect to weight wj?

6

Which hyper‑parameter controls how many training examples are processed before the model’s parameters are updated?

7

In a deep network, why does back‑propagation become computationally intensive as the number of layers increases?

8

Which activation function is defined as a(z) = 1 / (1 + e^{‑z})?

9

During training, what is the purpose of splitting the dataset into training and test sets?

10

In the context of a perceptron, what does the term 'bias' (b) represent?

Fundamentals of Artificial Neural Networks

Artificial Neural Networks (ANNs) are the backbone of modern Artificial Intelligence and Machine Learning. This course breaks down the core concepts tested in a typical quiz, providing clear explanations, practical examples, and SEO‑friendly language to help you master the subject.

1. Single‑Layer Perceptron vs. Deep Neural Networks

A single‑layer perceptron is the simplest form of a neural network. It consists of an input layer directly connected to an output neuron, using a linear combination of inputs followed by an activation function. The main limitation of this architecture is its inability to model non‑linear relationships. Because the decision boundary is a hyperplane, a single‑layer perceptron can only represent linear functions. In contrast, deep neural networks stack multiple hidden layers, each applying non‑linear transformations, enabling them to approximate complex, highly non‑linear mappings.

  • Key takeaway: Deep networks overcome the linearity restriction of single‑layer perceptrons.
  • Why it matters: Real‑world data (images, speech, text) rarely follows a linear pattern.

2. Forward Propagation: Computing Layer Activations

During forward propagation, each layer k receives the activation vector from the previous layer A[k‑1]. The weighted sum is calculated as z[k] = W[k]·A[k‑1] + B[k], where W[k] is the weight matrix and B[k] the bias vector. The activation of layer k is then obtained by applying a non‑linear function, most commonly the sigmoid:

A[k] = sigmoid(W[k]·A[k‑1] + B[k])

This step introduces non‑linearity, allowing the network to learn complex patterns.

  • Common activation functions: sigmoid, tanh, ReLU, softmax.
  • Implementation tip: Vectorized operations (using NumPy or TensorFlow) speed up forward passes.

3. Universal Approximation Theorem

The Universal Approximation Theorem states that a feed‑forward network with at least one hidden layer containing a finite number of neurons can approximate any continuous bounded function on a compact subset of ℝⁿ, provided the activation function is non‑linear (e.g., sigmoid or ReLU). This theorem does not prescribe the exact architecture; it merely guarantees the existence of a sufficiently large network that can achieve an arbitrarily low approximation error.

  • Implication: Even a shallow network can, in theory, learn any continuous mapping, though deeper networks are often more efficient in practice.
  • Practical note: Over‑parameterizing a network may lead to over‑fitting; regularization techniques are essential.

4. Storing Intermediate Values for Back‑Propagation

Back‑propagation requires the gradient of the loss with respect to each weight. To compute these gradients efficiently, the network must retain certain intermediate values from the forward pass. The most critical stored quantity is the activation a(k) of each neuron. These activations are used to calculate the error signal (δ) for each layer, which then propagates backward through the network.

  • What is stored: activations, weighted sums (optional), and sometimes the derivative of the activation function.
  • Why store activations: They appear in the gradient formula: ∂L/∂W = δ·Aᵀ.

5. Gradient of Binary Cross‑Entropy with Sigmoid Activation

When training a binary classifier with a sigmoid output, the loss function commonly used is binary cross‑entropy (BCE). For a dataset of m examples, the gradient of the loss with respect to a weight w_j is:

∂L/∂w_j = (1/m) Σ_k (y_k – a_k)·a_k·(1–a_k)·x_{kj}

Here, y_k is the true label, a_k the sigmoid activation, and x_{kj} the input feature. The term a_k·(1–a_k) is the derivative of the sigmoid function, reflecting how the error propagates through the activation.

  • Key insight: The gradient combines the prediction error (y_k – a_k) with the sigmoid derivative.
  • Implementation tip: Vectorized computation of this gradient reduces training time dramatically.

6. Hyper‑Parameters: Batch Size

Among the many hyper‑parameters that influence training, the batch size determines how many training examples are processed before the model’s parameters are updated. A smaller batch size yields noisier gradient estimates but can improve generalization, while a larger batch size provides more stable gradients at the cost of higher memory usage.

  • Typical values: 32, 64, 128, 256.
  • Trade‑off: Larger batches accelerate GPU utilization; smaller batches may lead to faster convergence in some scenarios.

7. Computational Cost of Back‑Propagation in Deep Networks

Back‑propagation becomes increasingly demanding as the number of layers grows because each layer contributes a set of partial derivatives that must be computed and stored. The chain rule requires multiplying gradients across layers, leading to a computational complexity that scales linearly with the depth of the network but with a large constant factor due to matrix operations.

  • Why it matters: Deep networks with dozens or hundreds of layers can require significant GPU memory and processing time.
  • Optimization strategies: Gradient checkpointing, mixed‑precision training, and efficient libraries (e.g., cuDNN) help mitigate the cost.

8. The Sigmoid Activation Function

The sigmoid function is defined as a(z) = 1 / (1 + e^{-z}). It maps any real‑valued input into the interval (0, 1), making it ideal for binary classification tasks. Despite its popularity, sigmoid suffers from vanishing gradients for large positive or negative inputs, which is why modern architectures often prefer ReLU or its variants.

  • Properties: Smooth, differentiable, monotonic.
  • Derivative: a'(z) = a(z)·(1 – a(z)).

9. Putting It All Together: A Mini‑Project Blueprint

To reinforce the concepts, consider building a simple binary classifier for the Breast Cancer Wisconsin dataset:

  1. Load the data and split it into training and test sets.
  2. Normalize features to improve convergence.
  3. Define a network with one hidden layer (e.g., 16 neurons) using ReLU, and an output neuron with sigmoid activation.
  4. Choose binary cross‑entropy as the loss function and set a batch size of 64.
  5. Train the model using stochastic gradient descent (SGD) or Adam, monitoring the loss and accuracy.
  6. Evaluate the model on the test set and experiment with different batch sizes or deeper architectures.

Through this hands‑on exercise, you will experience forward propagation, back‑propagation, and the impact of hyper‑parameters firsthand.

10. Key Takeaways and Further Reading

Understanding the fundamentals of ANNs equips you to tackle more advanced topics such as convolutional networks, recurrent architectures, and transformer models. Below are recommended resources for deeper exploration:

  • Books: "Deep Learning" by Goodfellow, Bengio, and Courville.
  • Online courses: Coursera’s "Neural Networks and Deep Learning" by Andrew Ng.
  • Research papers: "Gradient Checkpointing" (Chen et al., 2016) for memory‑efficient back‑propagation.

By mastering these core concepts, you are well‑positioned to design, train, and evaluate sophisticated neural networks for a wide range of AI applications.