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

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

What distinguishes machine learning from traditional AI algorithms?

24 questions

  1. 1

    What distinguishes machine learning from traditional AI algorithms?

    1. A

      Machine learning is a subset of AI that only applies to game bots.

    2. B

      Traditional AI uses neural networks, while machine learning does not.

    3. C

      Machine learning algorithms can learn and create their own rules, while traditional AI follows predefined rules.

    4. D

      Traditional AI is always more accurate than machine learning.

    Correct answer
    C

    Machine learning algorithms can learn and create their own rules, while traditional AI follows predefined rules.

    Explanation

    Traditional AI algorithms follow predefined rules, whereas machine learning allows algorithms to learn from data and generate their own rules, making it a key subset of AI.

  2. 2

    In a neural network, what are the layers between the input and output layers called?

    1. A

      Middle layers

    2. B

      Intermediate layers

    3. C

      Hidden layers

    4. D

      Activation layers

    Correct answer
    C

    Hidden layers

    Explanation

    The layers between the input and output layers are called hidden layers, as they are not directly visible from the input or output.

  3. 3

    What is the role of weights in a neural network?

    1. A

      They add a constant to the neuron's output.

    2. B

      They connect neurons and multiply the input signal.

    3. C

      They determine the number of layers in the network.

    4. D

      They apply the activation function to the neuron.

    Correct answer
    B

    They connect neurons and multiply the input signal.

    Explanation

    Weights are the connections between neurons that multiply the input value. Each connection has a weight that the input is multiplied by before being summed.

  4. 4

    What does a bias in a neural network allow?

    1. A

      It multiplies the input by a constant.

    2. B

      It prevents overfitting.

    3. C

      It increases the number of layers.

    4. D

      It shifts the activation function away from the origin.

    Correct answer
    D

    It shifts the activation function away from the origin.

    Explanation

    A bias is added to the weighted sum before the activation function, allowing the network to shift the output away from the origin, which is necessary for representing functions like f(x)=x+2.

  5. 5

    Without activation functions, a neural network with multiple layers can only represent:

    1. A

      Linear functions

    2. B

      Exponential functions

    3. C

      Polynomial functions

    4. D

      Non-linear functions

    Correct answer
    A

    Linear functions

    Explanation

    Without activation functions, combining linear layers through multiplication and addition results in another linear function. Activation functions introduce non-linearity.

  6. 6

    What is the primary purpose of an activation function in a neural network?

    1. A

      To reduce the number of parameters

    2. B

      To introduce non-linearity

    3. C

      To normalize the inputs

    4. D

      To speed up training

    Correct answer
    B

    To introduce non-linearity

    Explanation

    Activation functions introduce non-linearity, allowing the network to learn complex patterns beyond simple linear relationships.

  7. 7

    What does the ReLU activation function do for negative inputs?

    1. A

      Outputs one

    2. B

      Outputs zero

    3. C

      Outputs a negative value

    4. D

      Outputs the square of the input

    Correct answer
    B

    Outputs zero

    Explanation

    ReLU outputs 0 for any input less than or equal to 0, and outputs the input itself for positive values.

  8. 8

    What is the derivative of the ReLU function for an input greater than 0?

    1. A

      Undefined

    2. B

      1

    3. C

      0

    4. D

      The input value

    Correct answer
    B

    1

    Explanation

    For x > 0, the derivative of ReLU is 1. For x <= 0, the derivative is 0.

  9. 9

    Which activation function maps outputs to a range between 0 and 1?

    1. A

      Linear activation

    2. B

      ReLU

    3. C

      Step function

    4. D

      Sigmoid

    Correct answer
    D

    Sigmoid

    Explanation

    The sigmoid function squashes values to a range between 0 and 1, making it useful for probabilistic outputs.

  10. 10

    In supervised learning, what does the network use to learn?

    1. A

      Only input data

    2. B

      Labeled data

    3. C

      Unlabeled data

    4. D

      Random noise

    Correct answer
    B

    Labeled data

    Explanation

    Supervised learning uses labeled data, where each input has a known target output, so the network can learn to map inputs to outputs by comparing its predictions to the labels.

  11. 11

    What is the purpose of a cost (loss) function in training?

    1. A

      To initialize the weights

    2. B

      To determine the learning rate

    3. C

      To choose the activation function

    4. D

      To measure how well the network is performing

    Correct answer
    D

    To measure how well the network is performing

    Explanation

    The cost function quantifies the error between the network's outputs and the true labels, providing a measure of performance that the training algorithm aims to minimize.

  12. 12

    In gradient descent, how are weights and biases updated?

    1. A

      Subtracting the gradient multiplied by the learning rate

    2. B

      Adding the gradient multiplied by the learning rate

    3. C

      Multiplying them by the learning rate

    4. D

      Setting them to random values each iteration

    Correct answer
    A

    Subtracting the gradient multiplied by the learning rate

    Explanation

    Weights and biases are updated by moving in the opposite direction of the gradient of the cost function, scaled by the learning rate, to reduce the cost.

  13. 13

    What is the learning rate alpha used for?

    1. A

      It controls the step size during gradient descent.

    2. B

      It determines the number of hidden layers.

    3. C

      It decides the activation function.

    4. D

      It sets the initial weights.

    Correct answer
    A

    It controls the step size during gradient descent.

    Explanation

    The learning rate is a hyperparameter that scales the gradient update, controlling how much the weights change in each iteration.

  14. 14

    Why is it inefficient to compute gradients by numerically perturbing each weight?

    1. A

      It requires a forward pass for each weight, which is computationally expensive for large networks.

    2. B

      It only works with batch training.

    3. C

      It cannot be used with activation functions.

    4. D

      It is more accurate than backpropagation.

    Correct answer
    A

    It requires a forward pass for each weight, which is computationally expensive for large networks.

    Explanation

    The numerical method requires a separate forward pass to compute the cost for each weight and bias change, making it very slow for networks with many parameters.

  15. 15

    What does backpropagation compute efficiently?

    1. A

      The forward pass of the network

    2. B

      The optimal learning rate

    3. C

      The cost function value

    4. D

      The gradient of the cost with respect to all weights and biases

    Correct answer
    D

    The gradient of the cost with respect to all weights and biases

    Explanation

    Backpropagation uses the chain rule to compute gradients of the cost with respect to all parameters in a single forward and backward pass, making training feasible for large networks.

  16. 16

    In backpropagation, the derivative of the cost with respect to a weight is computed as a product of local derivatives. This is an application of:

    1. A

      The quotient rule

    2. B

      The power rule

    3. C

      The chain rule

    4. D

      The product rule

    Correct answer
    C

    The chain rule

    Explanation

    The chain rule allows the derivative of a composite function to be expressed as the product of derivatives of its constituent functions, which is exactly how backpropagation works.

  17. 17

    When computing gradients for a weight in an earlier layer, why do we sum over multiple paths?

    1. A

      Because the activation function has multiple outputs.

    2. B

      Because the cost is an average over data points.

    3. C

      Because the weight affects the cost through multiple neurons in later layers.

    4. D

      Because the weight is used in multiple layers.

    Correct answer
    C

    Because the weight affects the cost through multiple neurons in later layers.

    Explanation

    A single weight in an earlier layer influences multiple neurons in subsequent layers, so the total derivative is the sum of derivatives along all paths from that weight to the cost.

  18. 18

    What is the derivative of the cost function C=(a−y)2C = (a - y)^2C=(a−y)2 with respect to aaa?

    1. A

      (a−y)(a - y)(a−y)

    2. B

      a−ya - ya−y

    3. C

      2a2a2a

    4. D

      2(a−y)2(a - y)2(a−y)

    Correct answer
    D

    2(a−y)2(a - y)2(a−y)

    Explanation

    Using the power rule, the derivative of (a−y)2(a - y)^2(a−y)2 with respect to aaa is 2(a−y)2(a - y)2(a−y).

  19. 19

    In the notation used, what does zzz represent in a neuron?

    1. A

      The value after applying the activation function

    2. B

      The bias of the neuron

    3. C

      The value before applying the activation function

    4. D

      The weight of the connection

    Correct answer
    C

    The value before applying the activation function

    Explanation

    In the text, zzz denotes the weighted sum plus bias before the activation function, while aaa denotes the output after activation.

  20. 20

    What is the derivative of the cost with respect to a bias?

    1. A

      It is equal to the derivative with respect to the incoming weight.

    2. B

      It depends on the learning rate.

    3. C

      It is always 0.

    4. D

      It is always 1 when applying the chain rule through the bias's neuron.

    Correct answer
    D

    It is always 1 when applying the chain rule through the bias's neuron.

    Explanation

    When taking the derivative with respect to a bias, the derivative of the neuron's pre-activation value zzz with respect to the bias is 1, so the gradient flows through directly.

  21. 21

    A neural network with one input, one output, no hidden layers, a linear activation, and only a weight (no bias) can represent which type of function?

    1. A

      Any linear function f(x)=wx+bf(x) = wx + bf(x)=wx+b

    2. B

      Only functions of the form f(x)=wxf(x) = wxf(x)=wx

    3. C

      Any non-linear function

    4. D

      Only constant functions

    Correct answer
    B

    Only functions of the form f(x)=wxf(x) = wxf(x)=wx

    Explanation

    With only a weight and no bias, the output is wxw xwx, which is a line through the origin. Adding a bias allows wx+bw x + bwx+b.

  22. 22

    In the example training process, after computing gradients using backpropagation, how are the weights updated?

    1. A

      Divide by the gradient

    2. B

      Set to the gradient value

    3. C

      Subtract the gradient times the learning rate

    4. D

      Add the gradient times the learning rate

    Correct answer
    C

    Subtract the gradient times the learning rate

    Explanation

    Gradient descent updates weights by moving in the opposite direction of the gradient: new weight = old weight - learning_rate * gradient.

  23. 23

    What is one advantage of splitting data into batches during training?

    1. A

      It speeds up the process by using only a subset of data per update.

    2. B

      It eliminates the need for a learning rate.

    3. C

      It always results in better accuracy.

    4. D

      It reduces the number of epochs needed.

    Correct answer
    A

    It speeds up the process by using only a subset of data per update.

    Explanation

    Batch training updates weights based on a subset (batch) of the data, reducing the computational cost per update while still providing a reasonable gradient estimate.

  24. 24

    What is the output of a ReLU activation for input -5?

    1. A

      -5

    2. B

      5

    3. C

      25

    4. D

      0

    Correct answer
    D

    0

    Explanation

    ReLU outputs 0 for any input less than or equal to 0, so for -5, the output is 0.

Question 1 of 24
Question 1 of 24

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent