Getting Started with Machine Learning in JavaScript: Beginner Quiz Quiz

  1. Benefit of Browser-Based ML

    Which benefit of a JavaScript machine learning library allows models to run directly in the browser with interactive updates?

    1. Real-time training in the browser
    2. Requires server-only execution
    3. Needs a native desktop app
    4. Only works offline with batches
    5. Disables GPU acceleration
  2. Including a Library in the Browser

    What HTML element would you use to include a JavaScript machine learning library from a CDN in a web page?

    1. u003Cscript src='...'u003Eu003C/scriptu003E
    2. u003Clink rel='ml' href='...'u003E
    3. u003Cstyle src='...'u003Eu003C/styleu003E
    4. u003Cimport href='...'u003E
    5. u003Cmodule src='...'u003Eu003C/moduleu003E
  3. Installing for Server-Side JS

    Which environment typically uses npm to install packages for server-side JavaScript machine learning tasks?

    1. A server-side JavaScript runtime (using npm)
    2. A CSS preprocessor
    3. A SQL database
    4. A browser extension manifest
    5. A Java virtual machine
  4. Meaning of Sequential Model

    In a simple sequential model used for machine learning in JavaScript, what does 'sequential' describe?

    1. A linear stack of layers
    2. A cyclic graph network
    3. A collection of unrelated functions
    4. A database query plan
    5. A sorted dataset
  5. Dense Layer Input Shape

    If you create a dense layer to accept one numeric feature per example, what inputShape should you set?

    1. [1]
    2. [1, 1, 1]
    3. [0]
    4. [2]
    5. ['1']
  6. Optimizer Used in Example

    Which optimizer is used in the compilation step of the example to train the model predicting y from x?

    1. sgd
    2. adam
    3. rmsprop
    4. random-step
    5. gradient-ascent
  7. Loss for Regression

    For a simple regression task predicting numbers (for example, y = 2x - 1), which loss function is appropriate in the example?

    1. meanSquaredError
    2. categoricalCrossentropy
    3. binaryAccuracy
    4. hinge
    5. meanSquareError
  8. Tensor Shape for Inputs

    When preparing five input values [0, 1, 2, 3, 4] as a 2D tensor with one feature each, what shape should you use?

    1. [5, 1]
    2. [1, 5]
    3. [5]
    4. [1, 1, 5]
    5. [0, 5]
  9. Evaluate Linear Function

    Using the function y = 2x - 1 from the example, what is the correct output when x = 3?

    1. 5
    2. 7
    3. 6
    4. -5
    5. 2
  10. Browser Acceleration

    Which browser technology is commonly used by JavaScript machine learning libraries to speed up computations using the GPU?

    1. WebGL
    2. WebSQL
    3. WebMail
    4. Service Workers
    5. WebRTC