TensorFlow Flashcards

Tensor Flow, Vertex AI

1
Q

Which of the following statements is true of TensorFlow?

A

TensorFlow is a scalable and multi platform programming interface for implementing and
running machine learning algorithms, including convenience wrappers for deep learning.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How does TensorFlow represent numeric computations?

A

Using a Directed Acyclic Graph (or DAG)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which are useful components when building custom Neural Network models?

A

tf.losses

tf.metrics

tf.optimizers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which API is used to build performant, complex input pipelines from simple, re-usable pieces that will feed your model’s training or evaluation loops.

A

tf.data.Dataset

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What operations can be performed on tensors

A

They can be both reshaped and sliced

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is true when we compute a loss gradient? (3 Things)

A
  1. TensorFlow records all operations executed inside the context of a tf.GradientTape onto a
    tape.
  2. It uses tape and the gradients associated with each recorded operation to compute the
    gradients.
  3. The computed gradient of a recorded computation will be used in reverse mode
    differentiation.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are distinct ways to create a dataset?

A

Feature columns describe how the model should use raw input data from your features
dictionary.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which of the following is true about embedding?

A
  1. An embedding is a weighted sum of the feature crossed values.
  2. Embedding is a handy adapter that allows a network to incorporate spores or categorical data.
  3. The number of embeddings is the hyperparameter to your machine learning model.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the use of tf.keras.layers.TextVectorization?

A

It turns raw strings into an encoded representation that can be read by an Embedding layer or Dense layer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which is not a part of Categorical features preprocessing

A

tf.keras.layers.Discretization

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which of the layers is non-trainable?

A

Hashing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

When should you avoid using the Keras function adapt()?

A

When working with lookup layers with very large vocabularies

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which is a part of Keras preprocessing layers?

A
  1. Image data augmentation
  2. Image preprocessing
  3. Numerical features preprocessing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

True or false: Non-linearity helps in training your model at a much faster rate and with more accuracy without the loss of your important information?

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

During the training process, each additional layer in your network can successively reduce signal vs. noise. How can we fix this?

A

Use non-saturating, nonlinear activation functions such as ReLUs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How does Adam (optimization algorithm) help in compiling the Keras model?

A

Both by updating network weights iteratively based on training data by diagonal rescaling of
the gradients

17
Q

The predict function in the tf.keras API returns what?

A

Numpy array(s) of predictions

18
Q

What is the significance of the Fit method while training a Keras model?

A

Defines the number of epochs

19
Q

Difference to Keras Functional API

A

Unlike the Keras Sequential API, we have to provide the shape of the input to the model.

20
Q

The Keras Functional API can be characterized by having

A

Multiple inputs and outputs and models with shared layers

21
Q

How does regularization help build generalizable models ?

A

By adding dropout layers to our neural networks

22
Q

The L2 regularization provides what?

A

It adds a sum of the squared parameter weights term to the loss function.

23
Q

. When sending training jobs to Vertex AI, it is common to split most of the logic into a _________ and a ___________ file

A

task.py, model.py

24
Q

Which file is the entry point to your code that Vertex AI will start and contains details such as“how to parse command-line arguments and where to write model outputs?

A

task.py

25
Q

When you package up a TensorFlow model as a Python Package, what statement should every
Python module contain in every folder?

A

an init_.py

26
Q

To make your code compatible with Verte AI, there are three basic steps that must be completed in a specific order.

A

First, upload data to Google Cloud Storage. Next, move code into a trainer Python
package. Then submit your training job with gcloud to train on Vertex AI.

27
Q

You can use either pre-built containers or custom containers to run training
jobs. Both containers require you specify settings that Vertex AI needs to run your training code,
including __________, ____________, and ________.

A

Region, display-name, worker-pool-spec