tensorflow

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Question 7 If a sentence has 120 tokens in it, and a Conv1D with 128 filters with a Kernal size of 5 is passed over it, what's the output shape? (None, 116, 124) (None, 120, 128) (None, 116, 128) (None, 120, 124)

(None, 116, 128)

Question 5 What's the output shape of a bidirectional LSTM layer with 64 units? (None, 128) (128,1) (None, 64) (128,None)

(None, 64) WRONG (128,None) WRONG (None, 128) ???

Question 6 What was the sunspot seasonality? 1 point 11 or 22 years depending on who you ask 22 years 11 years 4 times a year

11 or 22 years depending on who you ask

After max pooling a 26x26 image with a 2x2 filter, how big will the output be? 1 point 56x56 28x28 26x26 13x13

13x13

Question 1 If I put a dropout parameter of 0.2, how many nodes will I lose? 1 point 20% of them 2% of them 20% of the untrained ones 2% of the untrained ones

20% of them

After passing a 3x3 filter over a 28x28 image, how big will the output be? 1 point 31x31 25x25 28x28 26x26

26x26

Question 2 What do the above mentioned Images look like? 1 point 28x28 Color 28x28 Greyscale 100x100 Color 82x82 Greyscale

28x28 Greyscale

Question 2 How many reviews are there in the IMDB dataset and how are they split? 60,000 records, 50/50 train/test split 50,000 records, 80/20 train/test split 50,000 records, 50/50 train/test split 60,000 records, 80/20 train/test split

50,000 records, 80/20 train/test split (wrong) 50,000 records, 50/50 train/test split

How many images are in the Fashion MNIST dataset? 1 point 42 10,000 60,000 70,000

70,000

Question 7 After studying this course, what neural network type do you think is best for predicting time series like our sunspots dataset? 1 point RNN / LSTM Convolutions DNN A combination of all of the above

A combination of all of the above

What is a windowed dataset? A fixed-size subset of a time series The time series aligned to a fixed shape A consistent set of subsets of a time series There's no such thing

A fixed-size subset of a time series

Question 3 What is imputed data? A good prediction of future data A bad prediction of future data Data that has been withheld for various reasons A projection of unknown (usually past or missing) data

A projection of unknown (usually past or missing) data

Question 5 What is Seasonality? Data aligning to the 4 seasons of the calendar A regular change in shape of the data Weather data Data that is only available at certain times of the year

A regular change in shape of the data

What is a Convolution? 1 point A technique to isolate features in images A technique to make images smaller A technique to make images bigger A technique to filter out unwanted images

A technique to isolate features in images

Question 2 What is a Pooling? 1 point A technique to make images sharper A technique to isolate features in images A technique to combine pictures A technique to reduce the information in an image while maintaining features

A technique to reduce the information in an image while maintaining features

What does a Lambda layer in a neural network do? Pauses training without a callback There are no Lambda layers in a neural network Allows you to execute arbitrary code while training Changes the shape of the input or output data

Allows you to execute arbitrary code while training

Question 6 What is a trend? An overall consistent upward direction for data An overall consistent downward direction for data An overall consistent flat direction for data An overall direction for data regardless of direction

An overall direction for data regardless of direction

The diagram for traditional programming had Rules and Data In, but what came out? 1 point Answers Binary Machine Learning Bugs

Answers

If you want to inspect the learned parameters in a layer after training, what's a good technique to use? Assign a variable to the layer and add it to the model using that variable. Inspect its properties after training Decompile the model and inspect the parameter set for that layer Run the model with unit data and inspect the output for that layer Iterate through the layers dataset of the model to find the layer you want

Assign a variable to the layer and add it to the model using that variable. Inspect its properties after training

Question 2 Why is transfer learning useful? 1 point Because I can use all of the data from the original training set Because I can use all of the data from the original validation set Because I can use the features that were learned from large datasets that I may not have access to Because I can use the validation metadata from large datasets that I may not have access to

Because I can use the features that were learned from large datasets that I may not have access to

Question 6 Why do dropouts help avoid overfitting? 1 point Because neighbor neurons can have similar weights, and thus can skew the final training Having less neurons speeds up training

Because neighbor neurons can have similar weights, and thus can skew the final training

Question 3 When training with augmentation, you noticed that the training is a little slower. Why? 1 point Because the training is making more mistakes Because there is more data to train on Because the image processing takes cycles Because the augmented data is bigger

Because the image processing takes cycles

Question 1 Why does sequence make a large difference when determining semantics of language? Because the order of words doesn't matter It doesn't Because the order in which words appear dictate their meaning Because the order in which words appear dictate their impact on the meaning of the sentence

Because the order in which words appear dictate their impact on the meaning of the sentence

Question 6 When predicting words to generate poetry, the more words predicted the more likely it will end up gibberish. Why? Because the probability that each word matches an existing phrase goes down the more words you create It doesn't, the likelihood of gibberish doesn't change Because you are more likely to hit words not in the training set Because the probability of prediction compounds, and thus increases overall

Because the probability that each word matches an existing phrase goes down the more words you create

Question 7 What is a major drawback of word-based training for text generation instead of character-based generation? Because there are far more words in a typical corpus than characters, it is much more memory intensive Word based generation is more accurate because there is a larger body of words to draw from Character based generation is more accurate because there are less characters to predict There is no major drawback, it's always better to do word-based training

Because there are far more words in a typical corpus than characters, it is much more memory intensive ??

What keras layer type allows LSTMs to look forward and backward in a sentence? Bilateral Bidirectional Bothdirection Unilateral

Bidirectional

Question 7 IMDB Reviews are either positive or negative. What type of loss function should be used in this scenario? Binary Gradient descent Binary crossentropy Categorical crossentropy Adam

Binary crossentropy

Question 3 You used a sunspots dataset that was stored in CSV. What's the name of the Python library used to read CSVs? PyFiles CSV CommaSeparatedValues PyCSV

CSV

Question 8 What is autocorrelation? Data that follows a predictable shape, even if the scale is different Data that doesn't have noise Data that automatically lines up seasonally Data that automatically lines up in trends

Data that follows a predictable shape, even if the scale is different

Question 4 What does the axis parameter of tf.expand_dims do? Defines if the tensor is X or Y Defines the axis around which to expand the dimensions Defines the dimension index at which you will expand the shape of the tensor Defines the dimension index to remove when you expand the tensor

Defines the dimension index at which you will expand the shape of the tensor

Question 6 When stacking LSTMs, how do you instruct an LSTM to feed the next one in the sequence? Ensure that they have the same number of units Ensure that return_sequences is set to True only on units that feed to another LSTM Ensure that return_sequences is set to True on all units Do nothing, TensorFlow handles this automatically

Ensure that they have the same number of units WRONG Do nothing, TensorFlow handles this automatically wrong

Question 4 When we specify the input_shape to be (300, 300, 3), what does that mean? 1 point There will be 300 images, each size 300, loaded in batches of 3 There will be 300 horses and 300 humans, loaded in batches of 3 Every Image will be 300x300 pixels, with 3 bytes to define color Every Image will be 300x300 pixels, and there should be 3 Convolutional Layers

Every Image will be 300x300 pixels, with 3 bytes to define color

Question 1 What's the name of the dataset of Fashion images used in this week's code? 1 point Fashion MNIST Fashion Tensors Fashion Data Fashion MN

Fashion MNIST

What is an example of a Univariate time series? Hour by hour weather Baseball scores Hour by hour temperature Fashion items

Hour by hour temperature

Question 2 What is an example of a Multivariate time series? Fashion items Hour by hour temperature Baseball scores Hour by hour weather

Hour by hour weather

A new loss function was introduced in this module, named after a famous statistician. What is it called? Hubble loss Hawking loss Hyatt loss Huber loss

Huber loss

What's the primary difference between a simple RNN and an LSTM LSTMs have a single output, RNNs have multiple In addition to the H output, RNNs have a cell state that runs across all cells LSTMs have multiple outputs, RNNs have a single one In addition to the H output, LSTMs have a cell state that runs across all cells

In addition to the H output, LSTMs have a cell state that runs across all cells

Question 4 What does the fill_mode parameter do? 1 point There is no fill_mode parameter It creates random noise in the image It attempts to recreate lost information after a transformation like a shear It masks the background of an image

It attempts to recreate lost information after a transformation like a shear

Question 6 Applying Convolutions on top of our Deep neural network will make training: 1 point It depends on many factors. It might make your training faster or slower, and a poorly designed Convolutional layer may even be less efficient than a plain DNN! Stay the same Faster Slower

It depends on many factors. It might make your training faster or slower, and a poorly designed Convolutional layer may even be less efficient than a plain DNN!

Why is MAE a good analytic for measuring accuracy of predictions for time series? 1 point It punishes larger errors It biases towards small errors It doesn't heavily punish larger errors like square errors do It only counts positive errors

It doesn't heavily punish larger errors like square errors do

What does 'drop_remainder=true' do? It ensures that all rows in the data window are the same length by adding data It ensures that all data is used It ensures that the data is all the same shape It ensures that all rows in the data window are the same length by cropping data

It ensures that all rows in the data window are the same length by cropping data

What is the purpose of the embedding dimension? It is the number of letters in the word, denoting the size of the encoding It is the number of words to encode in the embedding It is the number of dimensions for the vector representing the word encoding It is the number of dimensions required to encode every word in the corpus

It is the number of dimensions for the vector representing the word encoding

Question 5 What does Relu do? 1 point It only returns x if x is less than zero It returns the negative of x It only returns x if x is greater than zero For a value x, it returns 1/x

It only returns x if x is greater than zero

Question 6 How does Image Augmentation help solve overfitting? 1 point It slows down the training process It manipulates the training set to generate more scenarios for features in the images It manipulates the validation set to generate more scenarios for features in the images It automatically fits features to images by finding them through image processing techniques

It slows down the training process

When tokenizing a corpus, what does the num_words=n parameter do? It specifies the maximum number of words to be tokenized, and stops tokenizing when it reaches n It specifies the maximum number of words to be tokenized, and picks the most common 'n' words It errors out if there are more than n distinct words in the corpus It specifies the maximum number of words to be tokenized, and picks the first 'n' words that were tokenized

It specifies the maximum number of words to be tokenized, and picks the most common 'n' words

Using Image Generator, how do you label images? 1 point You have to manually do it It's based on the file name TensorFlow figures it out from the contents It's based on the directory the image is contained in

It's based on the directory the image is contained in

Question 5 What does MAE stand for? Mean Average Error Mean Advanced Error Mean Absolute Error Mean Active Error

Mean Absolute Error

What does MSE stand for? Mean Squared error Mean Second error Mean Series error Mean Slight error

Mean Squared error

Question 8 What's the best way to avoid overfitting in NLP datasets? Use LSTMs Use GRUs Use Conv1D None of the above

None of the above

Question 5 When using Image Augmentation with the ImageDataGenerator, what happens to your raw image data on-disk. 1 point It gets overwritten, so be sure to make a backup A copy is made and the augmentation is done on the copy Nothing, all augmentation is done in-memory It gets deleted

Nothing, all augmentation is done in-memory

Question 9 What is a non-stationary time series? One that is consistent across all seasons One that moves seasonally One that has a constructive event forming trend and seasonality One that has a disruptive event breaking trend and seasonality

One that has a disruptive event breaking trend and seasonality

When padding sequences, if you want the padding to be at the end of the sequence, how do you do it?

Pass padding='post' to pad_sequences when initializing it

Question 3 How are the labels for the IMDB dataset encoded? Reviews encoded as a number 1-10 Reviews encoded as a number 1-5 Reviews encoded as a boolean true/false Reviews encoded as a number 0-1

Reviews encoded as a number 0-1

Question 8 When using IMDB Sub Words dataset, our results in classification were poor. Why? We didn't train long enough Sequence becomes much more important when dealing with subwords, but we're ignoring word positions The sub words make no sense, so can't be classified Our neural network didn't have enough layers

Sequence becomes much more important when dealing with subwords, but we're ignoring word positions

When using Image Augmentation my training gets... 1 point Slower Faster Stays the Same Much Faster

Slower

A sound wave is a good example of time series data T/F

T

What is the name of the TensorFlow library containing common data that you can use to train and test neural networks? TensorFlow Data Libraries TensorFlow Data TensorFlow Datasets There is no library of common data sets, you have to use your own

TensorFlow Datasets

What is a sequence to vector if an RNN has 30 cells numbered 0 to 29 The Y(hat) for the first cell The total Y(hat) for all cells The Y(hat) for the last cell The average Y(hat) for all 30 cells

The Y(hat) for the last cell

Question 2 Why does the DNN for Fashion MNIST have 10 output neurons? 1 point To make it train 10x faster To make it classify 10x faster Purely Arbitrary The dataset has 10 classes

The dataset has 10 classes

What would the symptom of a Dropout rate being set too high? 1 point The network would lose specialization to the effect that it would be inefficient or ineffective at learning, driving accuracy down Training time would increase due to the extra calculations being required for higher dropout

The network would lose specialization to the effect that it would be inefficient or ineffective at learning, driving accuracy down

Question 3 How did we specify the training size for the images? 1 point The target_size parameter on the training generator The training_size parameter on the validation generator The training_size parameter on the training generator The target_size parameter on the validation generator

The target_size parameter on the training generator

If you don't use a token for out of vocabulary words, what happens at encoding?

The word isn't encoded, and is skipped in the sequence

Question 4 In the fashion MNIST dataset, Why are there 10 output neurons? 1 point Purely arbitrary There are 10 different labels To make it classify 10x faster To make it train 10x faster

There are 10 different labels

Convolutional Neural Networks are better for classifying images like horses and humans because: 1 point In these images, the features may be in different parts of the frame There's a wide variety of horses There's a wide variety of humans All of the above

There's a wide variety of humans

How do Recurrent Neural Networks help you understand the impact of sequence on meaning? They carry meaning from one cell to the next They look at the whole sentence at a time They shuffle the words evenly They don't

They carry meaning from one cell to the next

How do Convolutions improve image recognition? 1 point They make the image smaller They make the image clearer They make processing of images faster They isolate features in images

They isolate features in images

If you have a number of sequences of different length, and call pad_sequences on them, what's the default result?

They'll get padded to the length of the longest sequence by adding zeros to the beginning of shorter ones

Question 6 Why do you split data into training and test sets? 1 point To make training quicker To test a network with previously unseen data To make testing quicker To train a network with previously unseen data

To test a network with previously unseen data

What is the name of the object used to tokenize sentences?

Tokenizer

Question 8 Using Image Augmentation effectively simulates having a larger data set for training. 1 point False True

True

In the context of time series, what is noise? Unpredictable changes in time series data Data that doesn't have seasonality Sound waves forming a time series Data that doesn't have a trend

Unpredictable changes in time series data

How do you add a 1 dimensional convolution to your model for predicting time series data? Use a Conv1D layer type Use a 1DConvolution layer type Use a Convolution1D layer type Use a 1DConv layer type

Use a Conv1D layer type

Question 9 If you want to amend the learning rate of the optimizer on the fly, after each epoch, what do you do? Use a LearningRateScheduler and pass it as a parameter to a callback Callback to a custom function and change the SGD property Use a LearningRateScheduler object in the callbacks namespace and assign that to the callback You can't set it

Use a LearningRateScheduler and pass it as a parameter to a callback wrong

Question 2 If my training data only has people facing left, but I want to classify people facing right, how would I avoid overfitting? 1 point Use the 'flip' parameter Use the 'flip' parameter and set 'horizontal' Use the 'horizontal_flip' parameter Use the 'flip_vertical' parameter around the Y axis

Use the 'horizontal_flip' parameter

Question 8 How do you set the learning rate of the SGD optimizer? Use the lr property Use the Rate property Use the RateOfLearning property You can't set it

Use the lr property

If you have a number of sequences of different lengths, how do you ensure that they are understood when fed into a neural network? Process them on the input layer of the Neural Network using the pad_sequences property Make sure that they are all the same length using the pad_sequences method of the tokenizer Use the pad_sequences object from the tensorflow.keras.preprocessing.sequence namespace Specify the input layer of the Neural Network to expect different sizes with dynamic_length

Use the pad_sequences object from the tensorflow.keras.preprocessing.sequence namespace

Question 1 How do you use Image Augmentation in TensorFLow 1 point Using parameters to the ImageDataGenerator You have to write a plugin to extend tf.layers With the keras.augment API With the tf.augment API

Using parameters to the ImageDataGenerator

How does an LSTM help understand meaning when words that qualify each other aren't necessarily beside each other in a sentence? They shuffle the words randomly They don't Values from earlier words can be carried to later ones via a cell state They load all words into a cell state

Values from earlier words can be carried to later ones via a cell state

Question 8 How does an LSTM help understand meaning when words that qualify each other aren't necessarily beside each other in a sentence? They shuffle the words randomly They load all words into a cell state Values from earlier words can be carried to later ones via a cell state They don't

Values from earlier words can be carried to later ones via a cell state

Question 7 After reducing the size of the images, the training results were different. Why? 1 point We removed some convolutions to handle the smaller images There was more condensed information in the images The training was faster There was less information in the images

We removed some convolutions to handle the smaller images

How do you change the number of classes the model can classify when using transfer learning? (i.e. the original model handled 1000 classes, but yours handles just 2) 1 point Ignore all the classes above yours (i.e. Numbers 2 onwards if I'm just classing 2) Use all classes but set their weights to 0 When you add your DNN at the bottom of the network, you specify your output layer with the number of classes you want Use dropouts to eliminate the unwanted classes

When you add your DNN at the bottom of the network, you specify your output layer with the number of classes you want

If X is the standard notation for the input to an RNN, what are the standard notations for the outputs? Y H Y(hat) and H H(hat) and Y

Y(hat) and H

Question 5 Can you use Image Augmentation with Transfer Learning Models? 1 point No, because you are using pre-set features Yes, because you are adding new layers at the bottom of the network, and you can use image augmentation when training these

Yes, because you are adding new layers at the bottom of the network, and you can use image augmentation when training these

Question 5 If your training data is close to 1.000 accuracy, but your validation data isn't, what's the risk here? 1 point You're overfitting on your validation data You're underfitting on your validation data You're overfitting on your training data No risk, that's a great result

You're overfitting on your training data

Question 8 What happens if you define a neural network with these two layers? tf.keras.layers.Bidirectional(tf.keras.layers.LSTM(32)), tf.keras.layers.Bidirectional(tf.keras.layers.LSTM(32)), tf.keras.layers.Dense(1), Your model will fail because you need return_sequences=True after each LSTM layer Your model will fail because you need return_sequences=True after the first LSTM layer Your model will compile and run correctly Your model will fail because you have the same number of cells in each LSTM

Your model will fail because you need return_sequences=True after the first LSTM layer

What's the input shape for a univariate time series to a Conv1D? [None, 1] [] [1] [1, None]

[None, 1]

What parameter to you set in your fit function to tell it to use callbacks? 1 point callback= oncallback= callbacks= oncallbacks=

callbacks=

Referring to time series , What's the correct line of code to split an n column window into n-1 columns for features and 1 column for a label dataset = dataset.map(lambda window: (window[n-1], window[1])) dataset = dataset.map(lambda window: (window[:-1], window[-1:])) dataset = dataset.map(lambda window: (window[-1:], window[:-1])) dataset = dataset.map(lambda window: (window[n], window[1]))

dataset = dataset.map(lambda window: (window[:-1], window[-1:]))

What is the name of the method used to tokenize a list of sentences? fit_to_text(sentences) fit_on_texts(sentences) tokenize(sentences) tokenize_on_text(sentences)

fit_on_texts(sentences)

When you read a row from a reader and want to cast column 2 to another data type, for example, a float, what's the correct syntax? 1 point Convert.toFloat(row[2]) float(row[2]) float f = row[2].read() You can't. It needs to be read into a buffer and a new float instantiated from the buffer

float(row[2])

How did you lock or freeze a layer from retraining? 1 point tf.freeze(layer) tf.layer.frozen = true tf.layer.locked = true layer.trainable = false

layer.trainable = false

Question 4 If your CSV file has a header that you don't want to read into your dataset, what do you execute before iterating through the file using a 'reader' object? 1 point reader.ignore_header() reader.next reader.read(next) next(reader)

next(reader)

What method gets called when an epoch finishes? 1 point on_epoch_end On_training_complete on_epoch_finished on_end

on_epoch_end

When initializing the tokenizer, how to you specify a token to use for unknown words?

oov_token=<Token>

Question 2 What method on the Image Generator is used to normalize the image? 1 point Rescale_image normalize rescale normalize_image

rescale

Once you have the corpus tokenized, what's the method used to encode a list of sentences to use those tokens?

texts_to_sequences(sentences)

If you want to clear out all temporary variables that tensorflow might have from previous sessions, what code do you run? tf.cache.clear_session() tf.cache.backend.clear_session() tf.keras.clear_session tf.keras.backend.clear_session()

tf.keras.backend.clear_session()

Which is the correct line of code for adding Dropout of 20% of neurons using TensorFlow 1 point tf.keras.layers.Dropout(20) tf.keras.layers.DropoutNeurons(20), tf.keras.layers.Dropout(0.2), tf.keras.layers.DropoutNeurons(0.2),

tf.keras.layers.Dropout(0.2),

To use word embeddings in TensorFlow, in a sequential layer, what is the name of the class? tf.keras.layers.Embed tf.keras.layers.Embedding tf.keras.layers.Word2Vector tf.keras.layers.WordEmbedding

tf.keras.layers.Embedding

If time values are in time[], series values are in series[] and we want to split the series into training and validation at time 1000, what is the correct code? time_train = time[:split_time] x_train = series[:split_time] time_valid = time[split_time] x_valid = series[split_time] time_train = time[split_time] x_train = series[split_time] time_valid = time[split_time] x_valid = series[split_time] time_train = time[:split_time] x_train = series[:split_time] time_valid = time[split_time:] x_valid = series[split_time:] time_train = time[split_time] x_train = series[split_time] time_valid = time[split_time:] x_valid = series[split_time:]

time_train = time[:split_time] x_train = series[:split_time] time_valid = time[split_time:] x_valid = series[split_time:]


Ensembles d'études connexes

Social Media Exam 4 (chp 15,16,17,18)

View Set

The client with respiratory health problems

View Set

AP Physics 1 Unit 5 Progress Check B

View Set

AMK_C393-08 Wireless & SOHO Networks

View Set

Unit 14 Vocabulary Choosing the Right Word

View Set