1. Home
  2. Explore
  3. Computer Science
  4. Intro to Neural Networks

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Intro to Neural Networks

  • 23Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Neural Network Basics

What is the key difference between traditional AI algorithms and machine learning?

23 questions

  1. 1

    What is the key difference between traditional AI algorithms and machine learning?

    Model answer

    Traditional AI algorithms follow predefined rules, while machine learning enables algorithms to learn and create their own rules.

    Explanation

    The content states that traditional AI (e.g., chess engines) follows set rules, whereas machine learning allows algorithms to learn rules from data.

  2. 2

    What are the three types of layers in a neural network?

    Model answer

    Input layer, hidden layers, and output layer.

    Explanation

    The content explicitly names these layers as the components of a neural network.

  3. 3

    Define a weight in a neural network.

    Model answer

    A weight is a connection between neurons in adjacent layers that multiplies the input value.

    Explanation

    The content describes weights as connections; each connection has a weight that acts as a multiplier.

  4. 4

    What is the purpose of a bias in a neuron?

    Model answer

    The bias is a value added after multiplying by the weight, allowing functions to shift away from the origin.

    Explanation

    The content explains that adding a bias moves the graph, enabling representation of functions like f(x)=x+2.

  5. 5

    How can a neural network with one input and one output, and no hidden layers, represent mathematical functions?

    Model answer

    It multiplies the input by a weight and adds a bias, representing linear functions of the form f(x)=wx+b.

    Explanation

    The content uses this simple network to illustrate linear function approximation.

  6. 6

    Why are neural networks considered function approximators?

    Model answer

    They take an input, process it, and produce an output, similar to mathematical functions, and can learn to approximate any function given enough neurons and layers.

    Explanation

    The content explicitly states that neural networks can be classified as function approximators.

  7. 7

    What happens to the output of a neural network when multiple hidden layers are added but no activation function is used?

    Model answer

    The output remains a linear function because composing linear functions yields a linear function.

    Explanation

    The content demonstrates that even with hidden layers, without activation functions, the network stays linear.

  8. 8

    Explain the role of an activation function in a neural network.

    Model answer

    An activation function introduces non-linearity, enabling the network to approximate non-linear functions.

    Explanation

    The content states that activation functions are necessary to go beyond linear functions.

  9. 9

    Describe the ReLU activation function and its output for positive and negative inputs.

    Model answer

    ReLU outputs 0 for inputs less than or equal to 0, and outputs the input itself for inputs greater than 0.

    Explanation

    The content describes ReLU as 'if the number is less than or equal to 0, output 0; otherwise leave it unchanged.'

  10. 10

    What is the step activation function?

    Model answer

    It returns 1 if the input is positive and 0 if it is not.

    Explanation

    The content defines the step function similarly.

  11. 11

    What range does the sigmoid activation function map inputs to?

    Model answer

    It squeezes all values into a range between 0 and 1.

    Explanation

    The content states that the sigmoid function outputs values in (0,1).

  12. 12

    What is supervised learning in the context of neural networks?

    Model answer

    Supervised learning uses labeled data where the network learns from input-output pairs.

    Explanation

    The content describes supervised learning as having labeled data fed into the network.

  13. 13

    How is the cost function defined for a neural network?

    Model answer

    The cost is the average of squared errors over all data points, where error is the difference between network output and true value.

    Explanation

    The content computes cost as (a2 - y)^2 averaged over all points.

  14. 14

    In gradient descent, how do we determine whether to increase or decrease a weight?

    Model answer

    We increase the weight if the derivative of the cost with respect to that weight is negative, and decrease it if positive.

    Explanation

    The content shows that increasing a weight when the derivative is negative lowers cost; the derivative indicates direction of steepest ascent, so we move opposite.

  15. 15

    What is the learning rate alphaalphaalpha in gradient descent?

    Model answer

    The learning rate is a small positive value that determines the step size when updating weights and biases.

    Explanation

    The content defines alpha as a value controlling the amount of change, e.g., alpha=0.02alpha = 0.02alpha=0.02.

  16. 16

    Why is the brute-force gradient approximation method slow?

    Model answer

    It requires calculating the cost for every weight and bias separately, each time running the network on all data points.

    Explanation

    The content notes that for large networks with many weights, this method is very slow.

  17. 17

    What is the advantage of using mini-batches during training?

    Model answer

    It speeds up the process because each iteration uses only a subset of the data instead of the full dataset.

    Explanation

    The content suggests splitting data into smaller batches to accelerate training.

  18. 18

    What is backpropagation?

    Model answer

    An algorithm that efficiently computes the gradient of the cost with respect to all weights and biases by propagating errors backward through the network.

    Explanation

    The content describes backpropagation as using derivatives and chain rule, starting at output and moving back.

  19. 19

    Write the expression for the derivative of the cost CCC with respect to the weight w111w_{111}w111​ in a network with two neurons per layer, using the chain rule.

    Model answer

    rac{partial C}{partial w_{111}} = rac{partial z_{11}}{partial w_{111}} cdot rac{partial a_{11}}{partial z_{11}} cdot left( rac{partial z_{21}}{partial a_{11}} v_{21} + rac{partial z_{22}}{partial a_{11}} v_{22} ight) where v21v_{21}v21​ and v22v_{22}v22​ are known from later layers.

    Explanation

    The content derives this specific expression, showing the path splits after a11a_{11}a11​.

  20. 20

    How is the derivative of the cost with respect to a bias different from that with respect to a weight?

    Model answer

    The derivative with respect to a bias replaces the derivative of zzz with respect to the weight (which is the input) with a constant 1.

    Explanation

    The content states that for a bias, the derivative is always 1, making it simpler.

  21. 21

    In backpropagation, why do we start from the last layer and work backward?

    Model answer

    Because calculating derivatives for earlier layers reuses values computed for later layers, saving computation.

    Explanation

    The content explains that backpropagation leverages already computed derivatives (e.g., vvv values) to efficiently compute earlier derivatives.

  22. 22

    What is the derivative of the sigmoid activation function sigma(x)sigma(x)sigma(x)?

    Model answer

    sigma′(x)=sigma(x)(1−sigma(x))sigma'(x) = sigma(x)(1 - sigma(x))sigma′(x)=sigma(x)(1−sigma(x))

    Explanation

    The content gives that derivative as 'a1 times (1 – a1)' when applied to the output.

  23. 23

    When a neuron in a hidden layer contributes to multiple outputs, how is its gradient computed?

    Model answer

    The gradients from each outgoing path are summed.

    Explanation

    The content shows for multiple outgoing connections, we sum the contributions from each path.

1 of 23
Question 1 of 23

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent