Deck 16: Deep Learning  

Full screen (f)
exit full mode
Question
In supervised deep learning, we aim to predict the ________ labels supplied with data samples.

A) goal
B) mark
C) object
D) target
Use Space or
up arrow
down arrow
to flip the card.
Question
Which of the following statements is false?

A) Keras is to xe "deep learning"deep learning as xe "scikit-learn (sklearn) machine-learning library"Scikit-learn is to xe "machine learning"machine learning.
B) Deep learning models are complex and require an extensive mathematical background to understand their inner workings.
C) Both Keras and Scikit-learn encapsulate the sophisticated mathematics of their models-developers need only define, parameterize and manipulate objects.
D) With Keras, you build your models primarily from custom components you develop to meet your unique requirements.
Question
Which of the following are not automated deep-learning capabilities?

A) Auto-Keras from Texas A&M University's DATA Lab
B) Baidu's xe "deep learning EZDL"xe "deep learning:EZDL"xe "EZDL automated deep learning (Baidu)"EZDL
C) Google's xe "AutoML"AutoML
D) Scikit-learn
Question
Which of the following are popular deep learning applications?

A) Game playing, computer vision, self-driving cars, robotics, improving customer experiences and chatbots
B) Diagnosing medical conditions, Google Search, facial recognition, automated image captioning, video closed captioning, enhancing image resolution
C) Speech recognition, language translation, predicting election results, predicting earthquakes and weather.
D) All of the above
Question
Which of the following statements a), b) or c) is false?

A) To use a custom Anaconda environment named tf_env, execute the following command, which affects only the current Terminal, shell or Anaconda Command Prompt: conda activate tf_env
B) When a custom environment is activated and you install more libraries, they become part of the activated environment, not the base environment.
C) If you open separate Terminals, shells or Anaconda Command Prompts, they'll use Anaconda's base environment by default.
D) All of the above statements are true.
Question
Which of the following statements is false?

A) Keras offers a friendly interface to Google's TensorFlow-the most widely used deep-learning library.
B) François Chollet of the Google Mind team developed Keras to make deep-learning capabilities more accessible.
C) Keras enables you to define deep-learning models conveniently with one statement.
D) Google has thousands of TensorFlow and Keras projects underway internally, and that number is growing quickly.
Question
Which of the following statements about Anaconda environments is false?

A) The Anaconda Python distribution makes it easy to create custom environments.
B) Custom environments are separate configurations in which you can install specific python and library version. These can help with xe "reproducibility"reproducibility if your code is specific to particular software and library versions and combinations.
C) Anaconda's default environment is called the root environment and is created when you install Anaconda and contains all the Python libraries that come with Anaconda. Unless you specify otherwise, additional libraries you install also are placed there.
D) Custom environments give you control over the specific libraries you wish to install for your specific tasks.
Question
Which of the following deep-learning demos translates a line drawing into a picture:

A) DeepArt.io.
B) DeepWarp Demo.
C) Image-to-Image Demo.
D) Google Translate Mobile App.
Question
Chollet discusses the types of tensors typically encountered in deep learning: \bullet A 0D (0-dimensional) tensor is one value and is known as a xe "scalar value"scalar.
\bullet A 1D tensor is similar to a one-dimensional array and is known as a xe "vector"vector. A 1D tensor might represent a sequence, such as hourly temperature readings from a sensor or the words of one movie review.
\bullet A 2D tensor is similar to a two-dimensional array and is known as a xe "matrix"matrix. A 2D tensor could represent a grayscale image in which the tensor's two dimensions are the image's width and height in pixels, and the value in each element is the intensity of that pixel.
Which of the following statements a), b) or c) about additional types of tensors is false?

A) A 3D tensor is similar to a three-dimensional array and could be used to represent a color image. The first two dimensions would represent the width and height of the image in pixels and the depth at each location might represent the red, green and blue (RGB) components of a given pixel's color. A 3D tensor also could represent a collection of 2D tensors containing grayscale images.
B) A 4D tensor could be used to represent a collection of color images in 3D tensors. It also could be used to represent one video. Each frame in a video is essentially a color image.
C) A 5D tensor could be used to represent a collection of 4D tensors containing videos.
D) All of the above statements are true.
Question
A tensor's ________ typically is represented in Python as a tuple of values in which the number of elements specifies the tensor's number of dimensions and each value in the tuple specifies the size of the tensor's corresponding dimension.

A) shape
B) frame
C) pattern
D) format
Question
________ neural networks are especially appropriate for computer vision tasks, such as recognizing handwritten digits and characters or recognizing objects (including faces) in images and videos.

A) LSTM
B) Recurrent
C) Convolutional
D) None of the above
Question
Which of the following statements a), b) or c) is false?

A) During training, the error rate is known as the loss, and the calculation that determines the loss is called the loss function.
B) Throughout training, the network determines the amount that each neuron contributes to the overall loss, then goes back through the layers and adjusts the weights in an effort to minimize that loss.
C) The technique mentioned in Part (b) is called backpropagation. Optimizing these weights occurs gradually-typically via a process called gradient descent.
D) All of the above statements are true.
Question
Which of the following statements is false?

A) Keras facilitates experimenting with many deep-learning models and tweaking them in various ways until you find the models that perform best for your applications.
B) Deep learning works well only when you have lots of data.
C) Transfer learning uses existing knowledge from a previously trained model as the foundation for a new model.
D) Data augmentation adds data to a dataset by deriving new data from existing data. For example, in an image dataset, you might rotate the images left and right so the model can learn about objects in different orientations.
Question
Which of the following statements a), b) or c) is false?

A) Powerful processors are needed for real-world deep learning because the size of tensors can be enormous and large-tensor operations can place crushing demands on processors.
B) NVIDIA GPUs (xe "Graphics Processing Unit (GPU)"Graphics Processing Units)-originally developed for computer gaming-are optimized for the mathematical matrix operations typically performed on tensors, an essential aspect of how deep learning works "under the hood."
C) Recognizing that deep learning is crucial to its future, Google developed TPUs (Tensor Processing Units). Google now uses TPUs in its Cloud TPU service, which can perform quadrillions of floating-point operations per second.
D) All of the above statements are true.
Question
Which of the following statements is false?

A) Deep learning frameworks generally manipulate data in the form of tensors.
B) A tensor is basically a one-dimensional array.
C) Frameworks like TensorFlow pack all your data into one or more tensors, which they use to perform the mathematical calculations that enable neural networks to learn.
D) These tensors can become quite large as the number of dimensions increases and as the richness of the data increases (for example, images, audios and videos are richer than text).
Question
People post their research papers at ________ in parallel with going through peer review for formal publication, hoping for fast feedback. So, this site gives you access to extremely current research.

A) https://kerasteam.slack.com.
B) https://blog.keras.io.
C) http://keras.io.
D) https://arXiv.org
Question
Which of the following statements a), b) or c) is false?

A) Deep learning can require significant processing power.
B) Complex models trained on big-data datasets can take hours, days or even more to train.
C) Special high-performance hardware called GPUs (xe "Graphics Processing Unit (GPU)"Graphics Processing Units) and xe "TPU (Tensor Processing Unit)"TPUs (Tensor Processing Units) developed by NVIDIA and Google, respectively, to meet the extraordinary processing demands of edge-of-the-practice deep-learning applications.
D) All of the above statements are true.
Question
Which of the following statements a), b) or c) about neural networks is false?

A) During the training phase, the network calculates values called weights for every connection between the neurons in one layer and those in the next.
B) On a neuron-by-neuron basis, each of its inputs is multiplied by that connection's weight, then the maximum of those xe "weighted inputs"weighted inputs is passed to the neuron's activation function.
C) The activation function's output determines which neurons to activate based on the inputs-just like the neurons in your brain passing information around in response to inputs coming from your eyes, nose, ears and more.
D) All of the above statements are true.
Question
Which of the following statements a), b) or c) is false?

A) Deep learning is a form of machine learning that uses artificial neural networks to learn.
B) An artificial neural network is a software construct that operates similarly to how scientists believe our brains work.
C) Our biological xe "central nervous system"nervous systems are controlled via xe "neuron:in biology"neurons that communicate with one another along pathways called xe "synapse in biology"synapses. As we learn, the specific neurons that enable us to perform a given task, like walking, communicate with one another more efficiently.
D) All of the above statements are true.
Question
Which of the following Keras datasets for practicing deep learning is used for sentiment analysis? xe "dataset:MNIST digits"xe "Keras:MNIST digits dataset"xe "MNIST handwritten digits dataset:Keras"a. MNIST.
Xe "dataset:Fashion-MNIST"xe "Keras:Fashion-MNIST dataset"xe "Fashion-MNIST dataset (Keras)"c. Fashion-MNIST.
D) xe "dataset:IMDb Movie reviews"xe "Keras:IMDb movie reviews dataset"xe "IMDb (the Internet Movie Database) dataset:imdb module from tensorflow.keras.\ndatasets"IMDb. xe "dataset:CIFAR10"xe "Keras:CIFAR10 dataset"xe "CIFAR10 dataset (Keras)"d. CIFAR10.
Question
Which of the following statements a), b) or c) is false?

A) The following code begins configuring a xe "convolutional neural network (CNN or convnet):model"convolutional neural network with a Keras Sequential model from the tensorflow.keras.models module:
[24]: from tensorflow.keras.models import Sequential
[25]: cnn = Sequential()
B) The network resulting from the code in Part (a) will execute its layers sequentially-the output of one layer becomes the input to the next.
C) Networks that operate as described in Part (b) are called feed-forward networks. All neural networks operate this way.
D) All of the above statements are true.
Question
Which of the following statements is false?

A) The following code imports the tensorflow.keras.datasets.mnist module containing the function that loads the MNIST dataset:
From tensorflow.keras.datasets import mnist
B) In the version of Keras built into TensorFlow, the Keras module names begin with "tensorflow.".
C) TensorFlow uses Keras to execute the deep-learning models.
D) The mnist module's load_data function loads the MNIST training and testing sets:
(X_train, y_train), (X_test, y_test) = mnist.load_data()
When you call load_data it will download the MNIST data to your system. The function returns a tuple of two elements containing the training and testing sets. Each element is itself a tuple containing the samples and labels, respectively.
Question
Which of the following statements a), b) or c) about convolution is false?

A) Kernel-size is a tunable hyperparameter.
B) For each kernel position, the convolution layer performs mathematical calculations using the kernel features to "learn" about them, then outputs one new feature to the layer's output.
C) By looking at features near one another, the network begins to recognize features like edges, straight lines and curves.
D) All of the above statements are true.
Question
Which of the following statements a), b) or c) is false?

A) In the "Machine Learning" chapter, we xe "handwritten digits:classification"xe "classification (machine learning):handwritten digits"classified handwritten digits using the 8-by-8-pixel, low-resolution images from the Digits dataset bundled with Scikit-learn.
B) The Digits dataset is based on a subset of the higher-resolution xe "MNIST handwritten digits dataset:Keras"MNIST handwritten digits dataset.
C) Recurrent neural networks are common in computer-vision applications, such as recognizing handwritten digits and characters, and recognizing objects in images and video.
D) All of the above statements are true.
Question
Which of the following statements a), b) or c) is false?

A) Scikit-learn's bundled datasets were preprocessed into the shapes its models require.
B) In real-world studies, you'll generally have to do some or all of the xe "data preparation"data preparation.
C) The MNIST dataset requires some preparation for use in a Keras convnet.
D) All of the above statements are true.
Question
Consider the following code: import numpy as np
Index = np.random.choice(np.arange(len(X_train)), 24, replace=False)
Figure, axes = plt.subplots(nrows=4, ncols=6, figsize=(16, 9))
For item in zip(axes.ravel(), X_train[index], y_train[index]):
Axes, image, target = item
Axes.imshow(image, cmap=plt.cm.gray_r)
Axes.set_xticks([]) # remove x-axis tick marks
Axes.set_yticks([]) # remove y-axis tick marks
Axes.set_title(target)
Plt)tight_layout()
Which of the following statements a), b) or c) is false?

A) NumPy's choice function (from the numpy.random module) selects the number of elements specified in its second argument from the front of the array of values in its first.
B) The choice function returns an array containing the selected values, which we store in index.
C) The expressions X_train[index] and y_train[index] use index to get the corresponding elements from both arrays.
D) All of the above statements are true.
Question
Which of the following statements about a convolutional layer a), b) or c) is false?

A) The areas that a convolutional layer learns from are called kernels.
B) For a 3-by-3 kernel, when the kernel finishes moving left-to-right and reaches the right edge of an image, the convolutional layer moves the kernel down three pixels and repeats this left-to-right process.
C) Kernels typically are 3-by-3, though larger kernels can be used for higher-resolution images.
D) All of the above statements are true.
Question
A ________ function produces a measure of how well a neural network predicts the target values.

A) activation
B) optimizer
C) loss
D) None of the above
Question
A typical convolutional neural network consists of several layers-an xe "input layer"input layer that receives the training samples, ________ layers that learn from the samples and an xe "output layer"output layer that produces the prediction probabilities.

A) intermediate
B) study
C) training
D) hidden
Question
The MNIST xe "convnet (convolutional neural network)"convnet's prediction for each MNIST digit will be an array of 10 probabilities, indicating the likelihood that the digit belongs to a particular one of the classes 0 through 9. When we evaluate the model's accuracy, Keras compares the model's predictions to the dataset's labels. To do that, Keras requires both to have the same ________.

A) profile
B) aspect
C) shape
D) frame
Question
Which of the following statements a), b) or c) is false?

A) Numeric features in data samples may have value ranges that vary widely. Deep learning networks perform better on data that is scaled either into the range 0.0 to 1.0, or to a range for which the data's mean is 1.0 and its standard deviation is 0.0. Getting your data into one of these forms is known as xe "normalized data"normalization.
B) In MNIST, each pixel is an integer in the range 0-255.
C) Assuming X_train and X_test represent the MNIST samples, the following code converts the MNIST pixel values to 32-bit (4-byte) floating-point numbers using the xe "NumPy:convert array to floating-point values"NumPy array method astype, then divides every element in the resulting array by 255, producing normalized values in the range 0.0-1.0:
X_train = X_train.astype('float32') / 255
X_test = X_test.astype('float32') / 255
D) All of the above statements are true.
Question
Which of the following statements a), b) or c) is false?

A) One-hot encoding converts data into arrays of 1.0s and 0.0s in which only one element is 1.0 and the rest are 0.0s.
B) For MNIST targets, the one-hot-encoded values will be 10-by-10 arrays representing the categories 0 through 9.
C) We know precisely which category each digit belongs to, so the categorical representation of a digit label will consist of a 1.0 at that digit's index and 0.0s for all the other elements.
D) All of the above statements are true.
Question
The IPython magic ________ indicates that Matplotlib-based graphics should be displayed in a Jupyter notebook rather than in separate windows.

A) %matplotlib notebook
B) %matplotlib inline
C) xe "magics:%matplotlib inline"xe "%matplotlib inline magic[matplotlib inline magic]"%matplotlib jupyter
D) None of the above
Question
Which of the following statements is false?

A) The number of filters depends on the image dimensions-higher-resolution images have more features, so they require more filters.
B) If you study the code the Keras team used to produce their pretrained convnets, you'll find that they used 64, 128 or even 256 filters in their first convolutional layers. Based on their convnets and the fact that the MNIST images are small, we used 64 filters in our first convolutional layer.
C) The set of filters produced by a convolution layer is called a feature map. Subsequent convolution layers combine features from previous feature maps to recognize larger features and so on. If we were doing facial recognition, early layers might recognize lines, edges and curves, and subsequent layers might begin combining those into larger features like eyes, eyebrows, noses, ears and mouths.
D) Once the network learns a feature, because of convolution, it no longer needs to recognize that feature elsewhere in the image.
Question
Which of the following statements a), b) or c) is false?

A) The following code imports several commonly used convnet layer classes from the xe "modules:tensorflow.keras.layers"xe "tensorflow.keras.layers module"tensorflow.keras.layers module:
From tensorflow.keras.layers import Conv2D, Dense, Flatten, MaxPooling2D
B) A xe "convolution layer"convolution layer uses the relationships between pixels that are close to one another to learn useful features (or patterns) in large areas of each sample.
C) The areas that convolution learns from are called kernels or patches.
D) All of the above statements are true.
Question
Which of the following statements a), b) or c) is false?

A) You should always get to know the data before working with it.
B) The following snippets check the dimensions of the MNIST training set images (X_train), training set labels (y_train), testing set images (X_test) and testing set labels (y_test):
[3]: X_train.shape
[3]: (60000, 28, 28)
[4]: y_train.shape
[4]: (60000,)
[5]: X_test.shape
[5]: (10000, 28, 28)
[6]: y_test.shape
[6]: (10000,)
C) You can see from X_train's and X_test's shapes that the MNIST images are the same resolution as those in Scikit-learn's Digits dataset.
D) All of the above statements are true.
Question
Which of the following statements is false?

A) Keras xe "convnet (convolutional neural network)"convnets require NumPy array inputs in which each sample has the shape: (width, height, channels)
B) For MNIST, each image's width and height are 28 pixels, and each pixel has one channel (the grayscale shade of the pixel from 0 to 255), so each sample's shape will be: (28, 28, 1)
C) Full-color images with RGB (red/green/blue) values for each pixel, would have three channels-one channel each for the red, green and blue components of a color.
D) As the neural network learns from the images, it reduces the number of channels.
Question
Which of the following statements about Keras neural network components is false?

A) A neural network is a sequence of layers containing the neurons used to learn from data samples. Each layer's neurons receive inputs, process them via an optimizer function, and produce outputs.
C) The data is fed into the network via an input layer that specifies the dimensions of the sample data.
D) The input layer is followed by hidden layers of neurons that implement the learning and an output layer that produces predictions. The more layers you stack, the deeper the network is (hence the term deep learning).
Question
Which of the following statements a), b) or c) is false?

A) The one-hot encoded representation of the digit 7 is: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0]
B) The tensorflow.keras.utils module provides function to_categorical to perform xe "one-hot encoding[one hot encoding]"one-hot encoding.
C) The to_categorical function counts the unique categories then, for each item being encoded, creates an array of that length with a 1.0 in the correct position.
D) All of the above statements are true.
Question
Which of the following statements a), b) or c) is false?

A) Reproducibility is crucial in scientific studies.
B) In deep learning, reproducibility is more difficult because the libraries sequentialize operations that perform floating-point calculations.
C) Getting reproducible results in Keras requires a combination of environment settings and code settings that are described in the Keras FAQ.
D) All of the above statements are true.
Question
Which of the following statements a), b) or c) is false?

A) To reduce overfitting and computation time, a convolution layer is often followed by one or more layers that increase the dimensionality of the convolution layer's output.
B) A pooling layer compresses (or down-samples) the results by discarding features, which helps make the model more general.
C) The most common pooling technique is called max pooling, which examines a 2-by-2 square of features and keeps only the maximum feature.
D) All of the above statements are true.
Question
Which of the following statements a), b) or c) is false?

A) TensorBoard is a TensorFlow tool for visualizing data from your deep-learning models as they execute.
B) You can view TensorFlow charts showing how the training and validation accuracy and loss values change through the epochs.
C) Andrej Karpathy's ConvnetJS tool, trains convnets in your web browser and dynamically visualizes the layers' outputs, including what each convolutional layer "sees" as it learns.
D) All of the above statements are true.
Question
Which of the following statements about a max pooling layer a), b) or c) is false?

A) A max pooling layer looks at a pool, then outputs the maximum feature from that pool.
B) Unlike convolution, there's no overlap between pools. Once the pool reaches the right edge, the pooling layer moves the pool down by its height-2 rows for a 2-by-2 pool-then continues from left-to-right. Because of the feature reduction in each group, 2-by-2 pooling compresses the number of features by 50%.
C) The following code adds a MaxPooling2D layer with a 2-by-2 pool to a model named cnn:
Cnn)add(MaxPooling2D(pool_size=(2, 2)))
D) All of the above statements are true.
Question
A Keras ________ layer reshapes its input to one dimension.

A) Dropout
B) Masking
C) Dense
D) Flatten
Question
The following code creates a TensorBoard object: from tensorflow.keras.callbacks import TensorBoard
Import time
Tensorboard_callback = TensorBoard(
Log_dir=f'./logs/mnist{time.time()}',
Histogram_freq=1, write_graph=True)
Which of the following statements a), b) or c) about the above code is false?

A) The log_dir argument is the name of the folder in which this model's log files will be written.
B) The notation './logs/' indicates that we're creating a new folder within the logs folder you created previously. The preceding code follows that folder with '/mnist' and the current time. Using the time ensures that each new execution of the notebook will have its own log folder. That will enable you to compare multiple executions in TensorBoard.
B) The histogram_freq argument is the frequency in epochs that Keras will output to the model's log files. In this case, we'll write data to the logs for every epoch.
C) When the write_graph argument is True, a graph of the model will be output. You can view the graph in the GRAPHS tab in TensorBoard.
D) All of the above statements are true.
Question
Which of the following statements a), b) or c) is false?

A) You can visualize the model summary using the plot_model function from the module tensorflow.keras.utils, as in:
From tensorflow.keras.utils import plot_model
From IPython.display import Image
Plot_model(cnn, to_file='convnet. png ', show_shapes=True,
Show_layer_names=True)
B) Module IPython.display's Image class can be used to load an image into a Jupyter Notebook and display the image in the notebook.
C) Keras assigns the layer names in the image.
D) All of the above statements are true.
Question
Which of the following statements a), b) or c) is false?

A) Calling our MNIST cnn model's predict method as shown below predicts the classes of the digit images in its argument array (X_test):
Predictions = cnn.predict(X_test)
B) You can check what the first sample digit should be by looking at y_test[0]:
[42]: y_test[0]
[42]: array([0., 0., 0., 0., 0., 0., 0., 1., 0., 0.], dtype=float32)
The one-hot encoding in the preceding output shows that the first sample is the digit 7.
C) The following code outputs the probabilities returned by the predict method for the first test sample:
[43]: for index, probability in enumerate(predictions[0]):
Print(f'{index}: {probability:.10%}')​
0: 0.0000000201%
1: 0.0000001355%
2: 0.0000186951%
3: 0.0000015494%
4: 0.0000000003%
5: 0.0000000012%
6: 0.0000000000%
7: 99.9999761581%
8: 0.0000005577%
9: 0.0000011416%
According to the preceding output, predictions[0] indicates that our cnn model believes this digit is a 7 with nearly 100% certainty. Not all predictions have this level of certainty.
D) All of the above statements are true.
Question
To use TensorBoard, before you fit your model, you need to configure a TensorBoard object, which the model will use to write data into a specified folder that TensorBoard monitors. This TensorBoard object is known as a ________ in Keras.

A) callforward
B) entry point
C) callback
D) None of the above.
Question
Which of the following statements a), b) or c) is false?

A) Neural network models can require significant training time. Once you've designed and tested a model that suits your needs, you can save its state. This allows you to load it later to make more predictions. Sometimes models are loaded and further trained for new problems. For example, layers in our model already know how to recognize features such as lines and curves, which could be useful in handwritten character recognition as well. This process is called transfer learning-you transfer an existing model's knowledge into a new model.
B) A Keras model's save method stores the model's architecture and state information in a format called Hierarchical Data Format (HDF5). Such files use the .xe "h5 file extension for Hierarchical Data Format files"h5 file extension.
C) You can load a saved model with the load_model function from the tensorflow.keras.models module, as in: from tensorflow.keras.models import load_model
Cnn = load_model('mnist_cnn.h5')
You can then invoke the loaded model's methods. For example, if you've acquired more data, you could call the model's predict method to make additional predictions on new data, or you could call the model's fit method to start training with the additional data.
D) All of the above statements are true.
Question
Which of the following statements is false?

A) The following code adds a Conv2D convolution layer to a model named cnn:
Cnn)add(Conv2D(filters=64,
Kernel_size=(3, 3),
Activation='relu',
Input_shape=(28, 28, 1)))
B) The Conv2D layer's first three arguments in Part (a) indicate: • The number of filters in the resulting feature map (filters=64).
• The size of the kernel used in each filter (kernel_size=(3, 3)).
• The 'relu' (Rectified Linear Unit) activation function is used to produce this layer's output (activation='relu'). 'relu' is the most widely used activation function in today's deep learning networks and is good for performance because it's easy to calculate. It's commonly recommended for convolutional layers.
C) Assuming the Conv2D layer in Part (a) is the first layer of the network, we also pass the input_shape=(28, 28,1) argument to specify the shape of each sample. This automatically creates an input layer to load the samples and pass them into the Conv2D layer, which is actually the first xe "hidden layer"hidden layer.
Question
Which of the following statements is false?

A) Overfitting can occur when your model is too simple compared to what it is modeling-in the most extreme overfitting case, a model memorizes its training data.
B) When you make predictions with an overfit model, they will be accurate if new data matches the training data, but the model could perform poorly with data it has never seen.
C) Overfitting tends to occur in deep learning as the dimensionality of the layers becomes too large.
D) Some techniques to prevent overfitting include training for fewer epochs, xe "data augmentation"data augmentation, xe "dropout"dropout and xe "L1 regularization"L1 or xe "regularization"xe "L2 regularization"L2 regularization.
Question
Consider the following code: cnn.add(Dense(units=10, activation='softmax'))
Which of the following statements a), b) or c) about our convolutional neural net that recognizes MNIST digits is false?

A) Our convnet's final layer in the preceding snippet is a Dense layer that classifies the inputs into neurons representing the classes 0 through 9.
B) The softmax activation function converts the values of these remaining 10 neurons into categorical string labels '0' through '9'.
C) The neuron that produces the highest probability represents the prediction for a given digit image.
D) All of the above statements are true.
Question
You train a Keras model by calling its fit method. Which of the following statements about the fit method is false?

A) As in Scikit-learn, the first two arguments are the training data and the categorical target labels.
B) The iterations argument specifies the number of times the model should process the entire set of training data.
C) batch_size specifies the number of samples to process at a time during each epoch. Most models specify a power of 2 from 32 to 512. Larger batch sizes can decrease model accuracy.
D) In general, some samples should be used to validate the model. If you specify validation data, after each epoch, the model will use it to make predictions and display the validation loss and accuracy. You can study these values to tune your layers and the fit method's hyperparameters, or possibly change the layer composition of your model.
Question
Which of the following statements a), b) or c) is false?

A) With deep learning networks, there's so much complexity and so much going on internally that's hidden from you that it's difficult to know and fully understand all the details. This creates challenges in testing, debugging and updating models and algorithms.
B) Deep learning learns the features but there may be enormous numbers of them, and they may not be apparent to you.
C) Google provides the TensorBoard tool for visualizing neural networks implemented in TensorFlow and Keras. A TensorBoard dashboard visualizes data from a deep learning model that can give you insights into how well your model is learning and potentially help you tune its hyperparameters.
D) All of the above statements are true.
Question
Which of the following statements is false?

A) Convnets often have many convolution and pooling layers.
B) The Keras team's convnets tend to double the number of filters in subsequent convolutional layers to enable the model to learn more relationships between the features.
C) The following snippets add a convolution layer with 128 filters, followed by a pooling layer to reduce the dimensionality by 50%:
Cnn)add(Conv2D(filters=128, kernel_size=(3, 3),
Activation='relu'))
Cnn)add(MaxPooling2D(pool_size=(2, 2)))
D) For odd dimensions like 11-by-11, Keras pooling layers round the dimensions down by default.
Question
Once you've added all the layers to a Keras neural network, you complete the Keras model by calling its compile method, as in: cnn.compile(optimizer='adam',
Loss='categorical_crossentropy',
Metrics=['accuracy'])
Which of the following statements about the arguments is false?

A) optimizer='adam' specifies the optimizer this model will use to adjust the weights throughout the neural network as it learns.
B) There are many optimizers -xe "optimizer:'adam'"xe "adam optimizer[adam optimizer]"'adam' performs well across a wide variety of models.
C) loss='xe "categorical_crossentropy loss function"xe "loss function:categorical_crossentropy"categorical_crossentropy' specifies the xe "loss function"loss function used by the optimizer in multi-classification networks like our convnet, which predicts 10 classes. As the neural network learns, the optimizer attempts to maximize the values returned by the loss function. The greater the loss, the better the neural network is at predicting what each image is.
D) metrics=['accuracy']-This is a list of the metrics that the network will produce to help you evaluate the model. We use the xe "accuracy of a model"accuracy metric to check the percentage of correct predictions.
Question
Consider the output of the following output produced by calling a Keras model's summary method: _________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
Conv2d_1 (Conv2D) (None, 26, 26, 64) 640
_________________________________________________________________
Max_pooling2d_1 (MaxPooling2 (None, 13, 13, 64) 0
_________________________________________________________________
Conv2d_2 (Conv2D) (None, 11, 11, 128) 73856
_________________________________________________________________
Max_pooling2d_2 (MaxPooling2 (None, 5, 5, 128) 0
_________________________________________________________________
Flatten_1 (Flatten) (None, 3200) 0
_________________________________________________________________
Dense_1 (Dense) (None, 128) 409728
_________________________________________________________________
Dense_2 (Dense) (None, 10) 1290
=================================================================
Total params: 485,514
Trainable params: 485,514
Non-trainable params: 0
_________________________________________________________________
Which of the following statements is false?

A) A model's summary method shows you the model's layers.
B) The parameters are the weights that the network learns during training. Our relatively small convnet, needs to learn nearly 500,000 parameters.
C) In the Output Shape column, None simply means that the model does not know in advance how many training samples you're going to provide-this is known only when you start the training.
D) By default, Keras trains only the parameters that most affect prediction accuracy.
Question
Consider the following code, which evaluates our convnet model using the MNIST test data: [38]: loss, accuracy = cnn.evaluate(X_test, y_test)
10000/10000 [==============================] - 4s 366us/step
[39]: loss
[39]: 0.026809450998473768
[40]: accuracy
[40]: 0.9917
Which of the following statements a), b) or c) is false?

A) You can check the accuracy of a model on data the model has not yet seen. To do so, call the model's evaluate method, which displays as its output how long it took to process the test samples.
B) According to the output of the preceding snippet, our xe "convnet (convolutional neural network)"convnet model is 99.17% accurate when predicting the labels for unseen data.
C) With a little online research, you can find models that can predict MNIST with nearly 100% accuracy.
D) Each of the above statements is true.
Question
Which of the following statements a), b) or c) is false?

A) TensorBoard monitors a folder you specify looking for files output by models during training.
B) TensorBoard loads the data from that folder into a browser-based dashboard.
C) TensorBoard can load data from multiple models at once and you can choose which to visualize. This makes it easy to compare several different models or multiple runs of the same model.
D) All of the above statements are true.
Question
Which of the following statements a), b) or c) is false?

A) Learning the relationships among features and performing classification is accomplished with partially connected Dense layers.
B) The following Dense layer creates 128 neurons (units) that learn from the outputs of the previous layer:
Cnn)add(Dense(units=128, activation='relu'))
C) Many convnets contain at least one Dense layer like the one above. Convnets geared to more complex image datasets with higher-resolution often have several Dense layers, commonly with 4096 neurons.
D) All of the above statements are true.
Question
Which of the following statements a), b) or c) is false?

A) Our convnet used stacked layers that were applied sequentially. Non-sequential models are possible with xe "recurrent neural network (RNN)"recurrent neural networks.
B) A recurrent neural network (RNN) processes sequences of data, such as time series or text in sentences.
C) The term "recurrent" comes from the fact that the neural network contains loops in which the output of a given layer becomes the input to that same layer in the next time step.
D) All of the above statements are true.
Question
With only two possible outputs, we use the ________ loss function.

A) mean_squared_error
B) binary_compression
C) categorical_crossentropy
D) binary_crossentropy
Question
Which of the following are popular predefined word embeddings?

A) GloVe
B) Word2Vec
C) (a) and (b)
D) None of the above.
Question
Which of the following statements is false?

A) The following snippet adds an LSTM layer to an RNN named rnn:
Rnn)add(LSTM(units=128, dropout=0.2, recurrent_dropout=0.2))
B) The units argument in Part (a)'s snippet specifies the number of neurons in the layer. The more neurons the more the network can remember. As a guideline, you can start with a value between the length of the sequences you're processing and the number of classes you're trying to predict.
C) The dropout argument specifies the percentage of neurons to randomly disable when processing the layer's input and output. Like the pooling layers in our convnet, dropout is a proven technique that reduces underfitting.
D) The recurrent_dropout argument specifies the percentage of neurons to randomly disable when the layer's output is fed back into the layer again to allow the network to learn from what it has seen previously.
Question
Which of the following statements is false?

A) The pad_sequences utility function (module tensorflow.keras.preprocessing.sequence) reshapes the rows in an array of to the number of features specified by the maxlen argument (200) and returns a two-dimensional array:
[16]: words_per_review = 200
[17]: from tensorflow.keras.preprocessing.sequence import pad_sequences
[18]: X_train = pad_sequences(X_train,
Maxlen=words_per_review)
B) If a sample has more features, pad_sequences truncates it to the specified length.
C) If a sample has fewer features, pad_sequences adds space characters to the beginning of the sequence to pad it to the specified length.
D) You can confirm X_train's new shape with the array's shape attribute:
[19]: X_train.shape
[19]: (25000, 200)
Question
Which of the following statements a), b) or c) is false?

A) Because IMDb movie reviews are numerically encoded in the dataset bundled with Keras, to view their original text, you need to know the word to which each number corresponds.
B) Keras's IMDb dataset provides a dictionary that maps the words to their indexes. Each word's corresponding value is its frequency ranking among all the words in the entire set of reviews.
C) In the dictionary mentioned in Part (b), the word with the ranking 1 is the most frequently occurring word (calculated by the Keras team from the dataset), the word with ranking 2 is the second most frequently occurring word, and so on. Though the dictionary values begin with 1 as the most frequently occurring word, in each encoded review, the ranking values are offset by 3. So any review containing the most frequently occurring word will have the value 4 wherever that word appears in the review.
D) All of the above statements are true.
Question
Which of the following statements is false?

A) In a time series, a time step is the next point in time.
B) In a text sequence, a "time step" would be the next word in a sequence of words.
C) The looping in convolutional neural networks enables them to learn and remember relationships among the data in the sequence.
D) The word "good" on its own has positive sentiment. However, when preceded by "not," which appears earlier in the sequence, the sentiment becomes negative.
Question
Which of the following statements is false?

A) The IMDb movie reviews dataset included with Keras contains 25,000 training samples and 25,000 testing samples, each labeled with its positive (1) or negative (0) sentiment.
B) The following code imports the xe "modules:tensorflow.keras.datasets"xe "tensorflow.keras.datasets module"tensorflow.keras.datasets.imdb module so we can load the dataset:
From tensorflow.keras.datasets import imdb
C) The imdb module's load_data function returns the IMDb training and testing sets. The load_data function enables you to specify the number of unique words to import as part of the training and testing data. The following code loads only the top 10,000 most frequently occurring words:
Number_of_words = 10000
(X_train, y_train), (X_test, y_test) = imdb.load_data(
Num_words=number_of_words)
D) The load_data call in Part (c) returns a tuple of two elements containing the samples and labels, respectively.
Question
Which of the following statements a), b) or c) is false?

A) Assuming the IMDb training set samples, training set labels, testing set samples and testing set labels are stored in X_train, y_train, X_test, and y_test, respectively, the following code snippets check their dimensions:
[4]: X_train.shape
[4]: (25000,)
[5]: y_train.shape
[5]: (25000,)
[6]: X_test.shape
[6]: (25000,)
[7]: y_test.shape
[7]: (25000,)
B) The arrays y_train and X_test are one-dimensional arrays containing 1s and 0s, indicating whether each review is positive or negative.
C) Based on the outputs from the snippets in Part (a), X_train and X_test appear to be one-dimensional. However, their elements actually are lists of integers, each representing one review's contents, as shown in the code below:
[8]: %pprint
[8]: Pretty printing has been turned OFF
[9]: X_train[123]
[9]: [1, 307, 5, 1301, 20, 1026, 2511, 87, 2775, 52, 116, 5, 31, 7, 4, 91, 1220, 102, 13, 28, 110, 11, 6, 137, 13, 115, 219, 141, 35, 221, 956, 54, 13, 16, 11, 2714, 61, 322, 423, 12, 38, 76, 59, 1803, 72, 8, 2, 23, 5, 967, 12, 38, 85, 62, 358, 99]
D) All of the above statements are true:
Question
A Keras model's ________ method returns the loss and accuracy values of a trained model.

A) assess
B) account
C) grade
D) evaluate
Question
Which of the following statements about the IMDb movie reviews dataset a), b) or c) is false?

A) The number of words per review varies, but the Keras requires all samples to have the same dimensions.
B) To use the IMDb dataset for deep learning, we need to restrict every review to the same number of words.
C) When performing the data preparation in Part (b), some reviews will need to be padded with additional data and others will need to be truncated.
D) All of the above statements are true.
Question
Which of the following statements a), b) or c) is false?

A) RNNs for text sequences take into account the relationships among the earlier and later parts of a sequence.
B) When determining the meaning of text there can be many words to consider and an arbitrary number of words in between them.
C) A Long Short-Term Memory (LSTM) layer makes a neural network convolutional and is optimized to handle learning from sequences.
D) All of the above statements are true.
Question
Which of the following statements a), b) or c) is false?

A) We've used xe "one-hot encoding[one hot encoding]"one-hot encoding to convert the MNIST dataset's integer labels into xe "categorical data"categorical data. The result for each label was a vector in which all but one element was 0. We could also do that for the index values that represent the words in the IMDb dataset.
B) For our IMDb example that processes 10,000 unique words, we'd need a 10,000-by-10,000 array to represent all the words. That's 100,000,000 elements, and almost all the array elements would be 0. This is not an efficient way to encode the data.
C) If we were to process all 88,000+ unique words in the IMDb dataset, we'd need an array of nearly eight billion elements.
D) All of the above statements are true.
Question
Which of the following statements a), b) or c) is false?

A) To xe "reduce dimensionality"reduce ambiguity, RNNs that process text sequences typically begin with an embedding layer that encodes each word in a compact xe "dense-vector representation"dense-vector representation.
B) The vectors produced by the embedding layer also capture the word's context-that is, how a given word relates to the words around it.
C) An embedding layer enables the RNN to learn word relationships among the training data.
D) All of the above statements are true.
Question
The ________ activation function, which is preferred for xe "binary classification"binary classification, reduces arbitrary values into the range 0.0-1.0, producing a probability.

A) softmax
B) relu
C) sigmoid
D) softplus
Question
Which of the following statements a), b) or c) is false regarding decoding IMDb movie reviews?

A) The following snippet gets the word-to-index dictionary by calling the function get_word_index from the tensorflow.keras.datasets.imdb module:
[10]: word_to_index = imdb.get_word_index()
B) The word 'great' might appear in a positive movie review, so the following code checks whether it's in the dictionary:
[11]: word_to_index['great']
[11]: 84
C) According to the Part (b) output, 'great' is the dataset's 84th most frequent word. If you use an expression like the one in Part (b) to look up a word that's not in the dictionary, you'll get an exception.
D) All of the above statements are true.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/76
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 16: Deep Learning  
1
In supervised deep learning, we aim to predict the ________ labels supplied with data samples.

A) goal
B) mark
C) object
D) target
D
2
Which of the following statements is false?

A) Keras is to xe "deep learning"deep learning as xe "scikit-learn (sklearn) machine-learning library"Scikit-learn is to xe "machine learning"machine learning.
B) Deep learning models are complex and require an extensive mathematical background to understand their inner workings.
C) Both Keras and Scikit-learn encapsulate the sophisticated mathematics of their models-developers need only define, parameterize and manipulate objects.
D) With Keras, you build your models primarily from custom components you develop to meet your unique requirements.
D
3
Which of the following are not automated deep-learning capabilities?

A) Auto-Keras from Texas A&M University's DATA Lab
B) Baidu's xe "deep learning EZDL"xe "deep learning:EZDL"xe "EZDL automated deep learning (Baidu)"EZDL
C) Google's xe "AutoML"AutoML
D) Scikit-learn
D
4
Which of the following are popular deep learning applications?

A) Game playing, computer vision, self-driving cars, robotics, improving customer experiences and chatbots
B) Diagnosing medical conditions, Google Search, facial recognition, automated image captioning, video closed captioning, enhancing image resolution
C) Speech recognition, language translation, predicting election results, predicting earthquakes and weather.
D) All of the above
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
5
Which of the following statements a), b) or c) is false?

A) To use a custom Anaconda environment named tf_env, execute the following command, which affects only the current Terminal, shell or Anaconda Command Prompt: conda activate tf_env
B) When a custom environment is activated and you install more libraries, they become part of the activated environment, not the base environment.
C) If you open separate Terminals, shells or Anaconda Command Prompts, they'll use Anaconda's base environment by default.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
6
Which of the following statements is false?

A) Keras offers a friendly interface to Google's TensorFlow-the most widely used deep-learning library.
B) François Chollet of the Google Mind team developed Keras to make deep-learning capabilities more accessible.
C) Keras enables you to define deep-learning models conveniently with one statement.
D) Google has thousands of TensorFlow and Keras projects underway internally, and that number is growing quickly.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
7
Which of the following statements about Anaconda environments is false?

A) The Anaconda Python distribution makes it easy to create custom environments.
B) Custom environments are separate configurations in which you can install specific python and library version. These can help with xe "reproducibility"reproducibility if your code is specific to particular software and library versions and combinations.
C) Anaconda's default environment is called the root environment and is created when you install Anaconda and contains all the Python libraries that come with Anaconda. Unless you specify otherwise, additional libraries you install also are placed there.
D) Custom environments give you control over the specific libraries you wish to install for your specific tasks.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
8
Which of the following deep-learning demos translates a line drawing into a picture:

A) DeepArt.io.
B) DeepWarp Demo.
C) Image-to-Image Demo.
D) Google Translate Mobile App.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
9
Chollet discusses the types of tensors typically encountered in deep learning: \bullet A 0D (0-dimensional) tensor is one value and is known as a xe "scalar value"scalar.
\bullet A 1D tensor is similar to a one-dimensional array and is known as a xe "vector"vector. A 1D tensor might represent a sequence, such as hourly temperature readings from a sensor or the words of one movie review.
\bullet A 2D tensor is similar to a two-dimensional array and is known as a xe "matrix"matrix. A 2D tensor could represent a grayscale image in which the tensor's two dimensions are the image's width and height in pixels, and the value in each element is the intensity of that pixel.
Which of the following statements a), b) or c) about additional types of tensors is false?

A) A 3D tensor is similar to a three-dimensional array and could be used to represent a color image. The first two dimensions would represent the width and height of the image in pixels and the depth at each location might represent the red, green and blue (RGB) components of a given pixel's color. A 3D tensor also could represent a collection of 2D tensors containing grayscale images.
B) A 4D tensor could be used to represent a collection of color images in 3D tensors. It also could be used to represent one video. Each frame in a video is essentially a color image.
C) A 5D tensor could be used to represent a collection of 4D tensors containing videos.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
10
A tensor's ________ typically is represented in Python as a tuple of values in which the number of elements specifies the tensor's number of dimensions and each value in the tuple specifies the size of the tensor's corresponding dimension.

A) shape
B) frame
C) pattern
D) format
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
11
________ neural networks are especially appropriate for computer vision tasks, such as recognizing handwritten digits and characters or recognizing objects (including faces) in images and videos.

A) LSTM
B) Recurrent
C) Convolutional
D) None of the above
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
12
Which of the following statements a), b) or c) is false?

A) During training, the error rate is known as the loss, and the calculation that determines the loss is called the loss function.
B) Throughout training, the network determines the amount that each neuron contributes to the overall loss, then goes back through the layers and adjusts the weights in an effort to minimize that loss.
C) The technique mentioned in Part (b) is called backpropagation. Optimizing these weights occurs gradually-typically via a process called gradient descent.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
13
Which of the following statements is false?

A) Keras facilitates experimenting with many deep-learning models and tweaking them in various ways until you find the models that perform best for your applications.
B) Deep learning works well only when you have lots of data.
C) Transfer learning uses existing knowledge from a previously trained model as the foundation for a new model.
D) Data augmentation adds data to a dataset by deriving new data from existing data. For example, in an image dataset, you might rotate the images left and right so the model can learn about objects in different orientations.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
14
Which of the following statements a), b) or c) is false?

A) Powerful processors are needed for real-world deep learning because the size of tensors can be enormous and large-tensor operations can place crushing demands on processors.
B) NVIDIA GPUs (xe "Graphics Processing Unit (GPU)"Graphics Processing Units)-originally developed for computer gaming-are optimized for the mathematical matrix operations typically performed on tensors, an essential aspect of how deep learning works "under the hood."
C) Recognizing that deep learning is crucial to its future, Google developed TPUs (Tensor Processing Units). Google now uses TPUs in its Cloud TPU service, which can perform quadrillions of floating-point operations per second.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
15
Which of the following statements is false?

A) Deep learning frameworks generally manipulate data in the form of tensors.
B) A tensor is basically a one-dimensional array.
C) Frameworks like TensorFlow pack all your data into one or more tensors, which they use to perform the mathematical calculations that enable neural networks to learn.
D) These tensors can become quite large as the number of dimensions increases and as the richness of the data increases (for example, images, audios and videos are richer than text).
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
16
People post their research papers at ________ in parallel with going through peer review for formal publication, hoping for fast feedback. So, this site gives you access to extremely current research.

A) https://kerasteam.slack.com.
B) https://blog.keras.io.
C) http://keras.io.
D) https://arXiv.org
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
17
Which of the following statements a), b) or c) is false?

A) Deep learning can require significant processing power.
B) Complex models trained on big-data datasets can take hours, days or even more to train.
C) Special high-performance hardware called GPUs (xe "Graphics Processing Unit (GPU)"Graphics Processing Units) and xe "TPU (Tensor Processing Unit)"TPUs (Tensor Processing Units) developed by NVIDIA and Google, respectively, to meet the extraordinary processing demands of edge-of-the-practice deep-learning applications.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
18
Which of the following statements a), b) or c) about neural networks is false?

A) During the training phase, the network calculates values called weights for every connection between the neurons in one layer and those in the next.
B) On a neuron-by-neuron basis, each of its inputs is multiplied by that connection's weight, then the maximum of those xe "weighted inputs"weighted inputs is passed to the neuron's activation function.
C) The activation function's output determines which neurons to activate based on the inputs-just like the neurons in your brain passing information around in response to inputs coming from your eyes, nose, ears and more.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
19
Which of the following statements a), b) or c) is false?

A) Deep learning is a form of machine learning that uses artificial neural networks to learn.
B) An artificial neural network is a software construct that operates similarly to how scientists believe our brains work.
C) Our biological xe "central nervous system"nervous systems are controlled via xe "neuron:in biology"neurons that communicate with one another along pathways called xe "synapse in biology"synapses. As we learn, the specific neurons that enable us to perform a given task, like walking, communicate with one another more efficiently.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
20
Which of the following Keras datasets for practicing deep learning is used for sentiment analysis? xe "dataset:MNIST digits"xe "Keras:MNIST digits dataset"xe "MNIST handwritten digits dataset:Keras"a. MNIST.
Xe "dataset:Fashion-MNIST"xe "Keras:Fashion-MNIST dataset"xe "Fashion-MNIST dataset (Keras)"c. Fashion-MNIST.
D) xe "dataset:IMDb Movie reviews"xe "Keras:IMDb movie reviews dataset"xe "IMDb (the Internet Movie Database) dataset:imdb module from tensorflow.keras.\ndatasets"IMDb. xe "dataset:CIFAR10"xe "Keras:CIFAR10 dataset"xe "CIFAR10 dataset (Keras)"d. CIFAR10.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
21
Which of the following statements a), b) or c) is false?

A) The following code begins configuring a xe "convolutional neural network (CNN or convnet):model"convolutional neural network with a Keras Sequential model from the tensorflow.keras.models module:
[24]: from tensorflow.keras.models import Sequential
[25]: cnn = Sequential()
B) The network resulting from the code in Part (a) will execute its layers sequentially-the output of one layer becomes the input to the next.
C) Networks that operate as described in Part (b) are called feed-forward networks. All neural networks operate this way.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
22
Which of the following statements is false?

A) The following code imports the tensorflow.keras.datasets.mnist module containing the function that loads the MNIST dataset:
From tensorflow.keras.datasets import mnist
B) In the version of Keras built into TensorFlow, the Keras module names begin with "tensorflow.".
C) TensorFlow uses Keras to execute the deep-learning models.
D) The mnist module's load_data function loads the MNIST training and testing sets:
(X_train, y_train), (X_test, y_test) = mnist.load_data()
When you call load_data it will download the MNIST data to your system. The function returns a tuple of two elements containing the training and testing sets. Each element is itself a tuple containing the samples and labels, respectively.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
23
Which of the following statements a), b) or c) about convolution is false?

A) Kernel-size is a tunable hyperparameter.
B) For each kernel position, the convolution layer performs mathematical calculations using the kernel features to "learn" about them, then outputs one new feature to the layer's output.
C) By looking at features near one another, the network begins to recognize features like edges, straight lines and curves.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
24
Which of the following statements a), b) or c) is false?

A) In the "Machine Learning" chapter, we xe "handwritten digits:classification"xe "classification (machine learning):handwritten digits"classified handwritten digits using the 8-by-8-pixel, low-resolution images from the Digits dataset bundled with Scikit-learn.
B) The Digits dataset is based on a subset of the higher-resolution xe "MNIST handwritten digits dataset:Keras"MNIST handwritten digits dataset.
C) Recurrent neural networks are common in computer-vision applications, such as recognizing handwritten digits and characters, and recognizing objects in images and video.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
25
Which of the following statements a), b) or c) is false?

A) Scikit-learn's bundled datasets were preprocessed into the shapes its models require.
B) In real-world studies, you'll generally have to do some or all of the xe "data preparation"data preparation.
C) The MNIST dataset requires some preparation for use in a Keras convnet.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
26
Consider the following code: import numpy as np
Index = np.random.choice(np.arange(len(X_train)), 24, replace=False)
Figure, axes = plt.subplots(nrows=4, ncols=6, figsize=(16, 9))
For item in zip(axes.ravel(), X_train[index], y_train[index]):
Axes, image, target = item
Axes.imshow(image, cmap=plt.cm.gray_r)
Axes.set_xticks([]) # remove x-axis tick marks
Axes.set_yticks([]) # remove y-axis tick marks
Axes.set_title(target)
Plt)tight_layout()
Which of the following statements a), b) or c) is false?

A) NumPy's choice function (from the numpy.random module) selects the number of elements specified in its second argument from the front of the array of values in its first.
B) The choice function returns an array containing the selected values, which we store in index.
C) The expressions X_train[index] and y_train[index] use index to get the corresponding elements from both arrays.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
27
Which of the following statements about a convolutional layer a), b) or c) is false?

A) The areas that a convolutional layer learns from are called kernels.
B) For a 3-by-3 kernel, when the kernel finishes moving left-to-right and reaches the right edge of an image, the convolutional layer moves the kernel down three pixels and repeats this left-to-right process.
C) Kernels typically are 3-by-3, though larger kernels can be used for higher-resolution images.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
28
A ________ function produces a measure of how well a neural network predicts the target values.

A) activation
B) optimizer
C) loss
D) None of the above
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
29
A typical convolutional neural network consists of several layers-an xe "input layer"input layer that receives the training samples, ________ layers that learn from the samples and an xe "output layer"output layer that produces the prediction probabilities.

A) intermediate
B) study
C) training
D) hidden
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
30
The MNIST xe "convnet (convolutional neural network)"convnet's prediction for each MNIST digit will be an array of 10 probabilities, indicating the likelihood that the digit belongs to a particular one of the classes 0 through 9. When we evaluate the model's accuracy, Keras compares the model's predictions to the dataset's labels. To do that, Keras requires both to have the same ________.

A) profile
B) aspect
C) shape
D) frame
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
31
Which of the following statements a), b) or c) is false?

A) Numeric features in data samples may have value ranges that vary widely. Deep learning networks perform better on data that is scaled either into the range 0.0 to 1.0, or to a range for which the data's mean is 1.0 and its standard deviation is 0.0. Getting your data into one of these forms is known as xe "normalized data"normalization.
B) In MNIST, each pixel is an integer in the range 0-255.
C) Assuming X_train and X_test represent the MNIST samples, the following code converts the MNIST pixel values to 32-bit (4-byte) floating-point numbers using the xe "NumPy:convert array to floating-point values"NumPy array method astype, then divides every element in the resulting array by 255, producing normalized values in the range 0.0-1.0:
X_train = X_train.astype('float32') / 255
X_test = X_test.astype('float32') / 255
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
32
Which of the following statements a), b) or c) is false?

A) One-hot encoding converts data into arrays of 1.0s and 0.0s in which only one element is 1.0 and the rest are 0.0s.
B) For MNIST targets, the one-hot-encoded values will be 10-by-10 arrays representing the categories 0 through 9.
C) We know precisely which category each digit belongs to, so the categorical representation of a digit label will consist of a 1.0 at that digit's index and 0.0s for all the other elements.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
33
The IPython magic ________ indicates that Matplotlib-based graphics should be displayed in a Jupyter notebook rather than in separate windows.

A) %matplotlib notebook
B) %matplotlib inline
C) xe "magics:%matplotlib inline"xe "%matplotlib inline magic[matplotlib inline magic]"%matplotlib jupyter
D) None of the above
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
34
Which of the following statements is false?

A) The number of filters depends on the image dimensions-higher-resolution images have more features, so they require more filters.
B) If you study the code the Keras team used to produce their pretrained convnets, you'll find that they used 64, 128 or even 256 filters in their first convolutional layers. Based on their convnets and the fact that the MNIST images are small, we used 64 filters in our first convolutional layer.
C) The set of filters produced by a convolution layer is called a feature map. Subsequent convolution layers combine features from previous feature maps to recognize larger features and so on. If we were doing facial recognition, early layers might recognize lines, edges and curves, and subsequent layers might begin combining those into larger features like eyes, eyebrows, noses, ears and mouths.
D) Once the network learns a feature, because of convolution, it no longer needs to recognize that feature elsewhere in the image.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
35
Which of the following statements a), b) or c) is false?

A) The following code imports several commonly used convnet layer classes from the xe "modules:tensorflow.keras.layers"xe "tensorflow.keras.layers module"tensorflow.keras.layers module:
From tensorflow.keras.layers import Conv2D, Dense, Flatten, MaxPooling2D
B) A xe "convolution layer"convolution layer uses the relationships between pixels that are close to one another to learn useful features (or patterns) in large areas of each sample.
C) The areas that convolution learns from are called kernels or patches.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
36
Which of the following statements a), b) or c) is false?

A) You should always get to know the data before working with it.
B) The following snippets check the dimensions of the MNIST training set images (X_train), training set labels (y_train), testing set images (X_test) and testing set labels (y_test):
[3]: X_train.shape
[3]: (60000, 28, 28)
[4]: y_train.shape
[4]: (60000,)
[5]: X_test.shape
[5]: (10000, 28, 28)
[6]: y_test.shape
[6]: (10000,)
C) You can see from X_train's and X_test's shapes that the MNIST images are the same resolution as those in Scikit-learn's Digits dataset.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
37
Which of the following statements is false?

A) Keras xe "convnet (convolutional neural network)"convnets require NumPy array inputs in which each sample has the shape: (width, height, channels)
B) For MNIST, each image's width and height are 28 pixels, and each pixel has one channel (the grayscale shade of the pixel from 0 to 255), so each sample's shape will be: (28, 28, 1)
C) Full-color images with RGB (red/green/blue) values for each pixel, would have three channels-one channel each for the red, green and blue components of a color.
D) As the neural network learns from the images, it reduces the number of channels.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
38
Which of the following statements about Keras neural network components is false?

A) A neural network is a sequence of layers containing the neurons used to learn from data samples. Each layer's neurons receive inputs, process them via an optimizer function, and produce outputs.
C) The data is fed into the network via an input layer that specifies the dimensions of the sample data.
D) The input layer is followed by hidden layers of neurons that implement the learning and an output layer that produces predictions. The more layers you stack, the deeper the network is (hence the term deep learning).
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
39
Which of the following statements a), b) or c) is false?

A) The one-hot encoded representation of the digit 7 is: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0]
B) The tensorflow.keras.utils module provides function to_categorical to perform xe "one-hot encoding[one hot encoding]"one-hot encoding.
C) The to_categorical function counts the unique categories then, for each item being encoded, creates an array of that length with a 1.0 in the correct position.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
40
Which of the following statements a), b) or c) is false?

A) Reproducibility is crucial in scientific studies.
B) In deep learning, reproducibility is more difficult because the libraries sequentialize operations that perform floating-point calculations.
C) Getting reproducible results in Keras requires a combination of environment settings and code settings that are described in the Keras FAQ.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
41
Which of the following statements a), b) or c) is false?

A) To reduce overfitting and computation time, a convolution layer is often followed by one or more layers that increase the dimensionality of the convolution layer's output.
B) A pooling layer compresses (or down-samples) the results by discarding features, which helps make the model more general.
C) The most common pooling technique is called max pooling, which examines a 2-by-2 square of features and keeps only the maximum feature.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
42
Which of the following statements a), b) or c) is false?

A) TensorBoard is a TensorFlow tool for visualizing data from your deep-learning models as they execute.
B) You can view TensorFlow charts showing how the training and validation accuracy and loss values change through the epochs.
C) Andrej Karpathy's ConvnetJS tool, trains convnets in your web browser and dynamically visualizes the layers' outputs, including what each convolutional layer "sees" as it learns.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
43
Which of the following statements about a max pooling layer a), b) or c) is false?

A) A max pooling layer looks at a pool, then outputs the maximum feature from that pool.
B) Unlike convolution, there's no overlap between pools. Once the pool reaches the right edge, the pooling layer moves the pool down by its height-2 rows for a 2-by-2 pool-then continues from left-to-right. Because of the feature reduction in each group, 2-by-2 pooling compresses the number of features by 50%.
C) The following code adds a MaxPooling2D layer with a 2-by-2 pool to a model named cnn:
Cnn)add(MaxPooling2D(pool_size=(2, 2)))
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
44
A Keras ________ layer reshapes its input to one dimension.

A) Dropout
B) Masking
C) Dense
D) Flatten
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
45
The following code creates a TensorBoard object: from tensorflow.keras.callbacks import TensorBoard
Import time
Tensorboard_callback = TensorBoard(
Log_dir=f'./logs/mnist{time.time()}',
Histogram_freq=1, write_graph=True)
Which of the following statements a), b) or c) about the above code is false?

A) The log_dir argument is the name of the folder in which this model's log files will be written.
B) The notation './logs/' indicates that we're creating a new folder within the logs folder you created previously. The preceding code follows that folder with '/mnist' and the current time. Using the time ensures that each new execution of the notebook will have its own log folder. That will enable you to compare multiple executions in TensorBoard.
B) The histogram_freq argument is the frequency in epochs that Keras will output to the model's log files. In this case, we'll write data to the logs for every epoch.
C) When the write_graph argument is True, a graph of the model will be output. You can view the graph in the GRAPHS tab in TensorBoard.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
46
Which of the following statements a), b) or c) is false?

A) You can visualize the model summary using the plot_model function from the module tensorflow.keras.utils, as in:
From tensorflow.keras.utils import plot_model
From IPython.display import Image
Plot_model(cnn, to_file='convnet. png ', show_shapes=True,
Show_layer_names=True)
B) Module IPython.display's Image class can be used to load an image into a Jupyter Notebook and display the image in the notebook.
C) Keras assigns the layer names in the image.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
47
Which of the following statements a), b) or c) is false?

A) Calling our MNIST cnn model's predict method as shown below predicts the classes of the digit images in its argument array (X_test):
Predictions = cnn.predict(X_test)
B) You can check what the first sample digit should be by looking at y_test[0]:
[42]: y_test[0]
[42]: array([0., 0., 0., 0., 0., 0., 0., 1., 0., 0.], dtype=float32)
The one-hot encoding in the preceding output shows that the first sample is the digit 7.
C) The following code outputs the probabilities returned by the predict method for the first test sample:
[43]: for index, probability in enumerate(predictions[0]):
Print(f'{index}: {probability:.10%}')​
0: 0.0000000201%
1: 0.0000001355%
2: 0.0000186951%
3: 0.0000015494%
4: 0.0000000003%
5: 0.0000000012%
6: 0.0000000000%
7: 99.9999761581%
8: 0.0000005577%
9: 0.0000011416%
According to the preceding output, predictions[0] indicates that our cnn model believes this digit is a 7 with nearly 100% certainty. Not all predictions have this level of certainty.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
48
To use TensorBoard, before you fit your model, you need to configure a TensorBoard object, which the model will use to write data into a specified folder that TensorBoard monitors. This TensorBoard object is known as a ________ in Keras.

A) callforward
B) entry point
C) callback
D) None of the above.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
49
Which of the following statements a), b) or c) is false?

A) Neural network models can require significant training time. Once you've designed and tested a model that suits your needs, you can save its state. This allows you to load it later to make more predictions. Sometimes models are loaded and further trained for new problems. For example, layers in our model already know how to recognize features such as lines and curves, which could be useful in handwritten character recognition as well. This process is called transfer learning-you transfer an existing model's knowledge into a new model.
B) A Keras model's save method stores the model's architecture and state information in a format called Hierarchical Data Format (HDF5). Such files use the .xe "h5 file extension for Hierarchical Data Format files"h5 file extension.
C) You can load a saved model with the load_model function from the tensorflow.keras.models module, as in: from tensorflow.keras.models import load_model
Cnn = load_model('mnist_cnn.h5')
You can then invoke the loaded model's methods. For example, if you've acquired more data, you could call the model's predict method to make additional predictions on new data, or you could call the model's fit method to start training with the additional data.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
50
Which of the following statements is false?

A) The following code adds a Conv2D convolution layer to a model named cnn:
Cnn)add(Conv2D(filters=64,
Kernel_size=(3, 3),
Activation='relu',
Input_shape=(28, 28, 1)))
B) The Conv2D layer's first three arguments in Part (a) indicate: • The number of filters in the resulting feature map (filters=64).
• The size of the kernel used in each filter (kernel_size=(3, 3)).
• The 'relu' (Rectified Linear Unit) activation function is used to produce this layer's output (activation='relu'). 'relu' is the most widely used activation function in today's deep learning networks and is good for performance because it's easy to calculate. It's commonly recommended for convolutional layers.
C) Assuming the Conv2D layer in Part (a) is the first layer of the network, we also pass the input_shape=(28, 28,1) argument to specify the shape of each sample. This automatically creates an input layer to load the samples and pass them into the Conv2D layer, which is actually the first xe "hidden layer"hidden layer.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
51
Which of the following statements is false?

A) Overfitting can occur when your model is too simple compared to what it is modeling-in the most extreme overfitting case, a model memorizes its training data.
B) When you make predictions with an overfit model, they will be accurate if new data matches the training data, but the model could perform poorly with data it has never seen.
C) Overfitting tends to occur in deep learning as the dimensionality of the layers becomes too large.
D) Some techniques to prevent overfitting include training for fewer epochs, xe "data augmentation"data augmentation, xe "dropout"dropout and xe "L1 regularization"L1 or xe "regularization"xe "L2 regularization"L2 regularization.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
52
Consider the following code: cnn.add(Dense(units=10, activation='softmax'))
Which of the following statements a), b) or c) about our convolutional neural net that recognizes MNIST digits is false?

A) Our convnet's final layer in the preceding snippet is a Dense layer that classifies the inputs into neurons representing the classes 0 through 9.
B) The softmax activation function converts the values of these remaining 10 neurons into categorical string labels '0' through '9'.
C) The neuron that produces the highest probability represents the prediction for a given digit image.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
53
You train a Keras model by calling its fit method. Which of the following statements about the fit method is false?

A) As in Scikit-learn, the first two arguments are the training data and the categorical target labels.
B) The iterations argument specifies the number of times the model should process the entire set of training data.
C) batch_size specifies the number of samples to process at a time during each epoch. Most models specify a power of 2 from 32 to 512. Larger batch sizes can decrease model accuracy.
D) In general, some samples should be used to validate the model. If you specify validation data, after each epoch, the model will use it to make predictions and display the validation loss and accuracy. You can study these values to tune your layers and the fit method's hyperparameters, or possibly change the layer composition of your model.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
54
Which of the following statements a), b) or c) is false?

A) With deep learning networks, there's so much complexity and so much going on internally that's hidden from you that it's difficult to know and fully understand all the details. This creates challenges in testing, debugging and updating models and algorithms.
B) Deep learning learns the features but there may be enormous numbers of them, and they may not be apparent to you.
C) Google provides the TensorBoard tool for visualizing neural networks implemented in TensorFlow and Keras. A TensorBoard dashboard visualizes data from a deep learning model that can give you insights into how well your model is learning and potentially help you tune its hyperparameters.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
55
Which of the following statements is false?

A) Convnets often have many convolution and pooling layers.
B) The Keras team's convnets tend to double the number of filters in subsequent convolutional layers to enable the model to learn more relationships between the features.
C) The following snippets add a convolution layer with 128 filters, followed by a pooling layer to reduce the dimensionality by 50%:
Cnn)add(Conv2D(filters=128, kernel_size=(3, 3),
Activation='relu'))
Cnn)add(MaxPooling2D(pool_size=(2, 2)))
D) For odd dimensions like 11-by-11, Keras pooling layers round the dimensions down by default.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
56
Once you've added all the layers to a Keras neural network, you complete the Keras model by calling its compile method, as in: cnn.compile(optimizer='adam',
Loss='categorical_crossentropy',
Metrics=['accuracy'])
Which of the following statements about the arguments is false?

A) optimizer='adam' specifies the optimizer this model will use to adjust the weights throughout the neural network as it learns.
B) There are many optimizers -xe "optimizer:'adam'"xe "adam optimizer[adam optimizer]"'adam' performs well across a wide variety of models.
C) loss='xe "categorical_crossentropy loss function"xe "loss function:categorical_crossentropy"categorical_crossentropy' specifies the xe "loss function"loss function used by the optimizer in multi-classification networks like our convnet, which predicts 10 classes. As the neural network learns, the optimizer attempts to maximize the values returned by the loss function. The greater the loss, the better the neural network is at predicting what each image is.
D) metrics=['accuracy']-This is a list of the metrics that the network will produce to help you evaluate the model. We use the xe "accuracy of a model"accuracy metric to check the percentage of correct predictions.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
57
Consider the output of the following output produced by calling a Keras model's summary method: _________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
Conv2d_1 (Conv2D) (None, 26, 26, 64) 640
_________________________________________________________________
Max_pooling2d_1 (MaxPooling2 (None, 13, 13, 64) 0
_________________________________________________________________
Conv2d_2 (Conv2D) (None, 11, 11, 128) 73856
_________________________________________________________________
Max_pooling2d_2 (MaxPooling2 (None, 5, 5, 128) 0
_________________________________________________________________
Flatten_1 (Flatten) (None, 3200) 0
_________________________________________________________________
Dense_1 (Dense) (None, 128) 409728
_________________________________________________________________
Dense_2 (Dense) (None, 10) 1290
=================================================================
Total params: 485,514
Trainable params: 485,514
Non-trainable params: 0
_________________________________________________________________
Which of the following statements is false?

A) A model's summary method shows you the model's layers.
B) The parameters are the weights that the network learns during training. Our relatively small convnet, needs to learn nearly 500,000 parameters.
C) In the Output Shape column, None simply means that the model does not know in advance how many training samples you're going to provide-this is known only when you start the training.
D) By default, Keras trains only the parameters that most affect prediction accuracy.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
58
Consider the following code, which evaluates our convnet model using the MNIST test data: [38]: loss, accuracy = cnn.evaluate(X_test, y_test)
10000/10000 [==============================] - 4s 366us/step
[39]: loss
[39]: 0.026809450998473768
[40]: accuracy
[40]: 0.9917
Which of the following statements a), b) or c) is false?

A) You can check the accuracy of a model on data the model has not yet seen. To do so, call the model's evaluate method, which displays as its output how long it took to process the test samples.
B) According to the output of the preceding snippet, our xe "convnet (convolutional neural network)"convnet model is 99.17% accurate when predicting the labels for unseen data.
C) With a little online research, you can find models that can predict MNIST with nearly 100% accuracy.
D) Each of the above statements is true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
59
Which of the following statements a), b) or c) is false?

A) TensorBoard monitors a folder you specify looking for files output by models during training.
B) TensorBoard loads the data from that folder into a browser-based dashboard.
C) TensorBoard can load data from multiple models at once and you can choose which to visualize. This makes it easy to compare several different models or multiple runs of the same model.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
60
Which of the following statements a), b) or c) is false?

A) Learning the relationships among features and performing classification is accomplished with partially connected Dense layers.
B) The following Dense layer creates 128 neurons (units) that learn from the outputs of the previous layer:
Cnn)add(Dense(units=128, activation='relu'))
C) Many convnets contain at least one Dense layer like the one above. Convnets geared to more complex image datasets with higher-resolution often have several Dense layers, commonly with 4096 neurons.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
61
Which of the following statements a), b) or c) is false?

A) Our convnet used stacked layers that were applied sequentially. Non-sequential models are possible with xe "recurrent neural network (RNN)"recurrent neural networks.
B) A recurrent neural network (RNN) processes sequences of data, such as time series or text in sentences.
C) The term "recurrent" comes from the fact that the neural network contains loops in which the output of a given layer becomes the input to that same layer in the next time step.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
62
With only two possible outputs, we use the ________ loss function.

A) mean_squared_error
B) binary_compression
C) categorical_crossentropy
D) binary_crossentropy
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
63
Which of the following are popular predefined word embeddings?

A) GloVe
B) Word2Vec
C) (a) and (b)
D) None of the above.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
64
Which of the following statements is false?

A) The following snippet adds an LSTM layer to an RNN named rnn:
Rnn)add(LSTM(units=128, dropout=0.2, recurrent_dropout=0.2))
B) The units argument in Part (a)'s snippet specifies the number of neurons in the layer. The more neurons the more the network can remember. As a guideline, you can start with a value between the length of the sequences you're processing and the number of classes you're trying to predict.
C) The dropout argument specifies the percentage of neurons to randomly disable when processing the layer's input and output. Like the pooling layers in our convnet, dropout is a proven technique that reduces underfitting.
D) The recurrent_dropout argument specifies the percentage of neurons to randomly disable when the layer's output is fed back into the layer again to allow the network to learn from what it has seen previously.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
65
Which of the following statements is false?

A) The pad_sequences utility function (module tensorflow.keras.preprocessing.sequence) reshapes the rows in an array of to the number of features specified by the maxlen argument (200) and returns a two-dimensional array:
[16]: words_per_review = 200
[17]: from tensorflow.keras.preprocessing.sequence import pad_sequences
[18]: X_train = pad_sequences(X_train,
Maxlen=words_per_review)
B) If a sample has more features, pad_sequences truncates it to the specified length.
C) If a sample has fewer features, pad_sequences adds space characters to the beginning of the sequence to pad it to the specified length.
D) You can confirm X_train's new shape with the array's shape attribute:
[19]: X_train.shape
[19]: (25000, 200)
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
66
Which of the following statements a), b) or c) is false?

A) Because IMDb movie reviews are numerically encoded in the dataset bundled with Keras, to view their original text, you need to know the word to which each number corresponds.
B) Keras's IMDb dataset provides a dictionary that maps the words to their indexes. Each word's corresponding value is its frequency ranking among all the words in the entire set of reviews.
C) In the dictionary mentioned in Part (b), the word with the ranking 1 is the most frequently occurring word (calculated by the Keras team from the dataset), the word with ranking 2 is the second most frequently occurring word, and so on. Though the dictionary values begin with 1 as the most frequently occurring word, in each encoded review, the ranking values are offset by 3. So any review containing the most frequently occurring word will have the value 4 wherever that word appears in the review.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
67
Which of the following statements is false?

A) In a time series, a time step is the next point in time.
B) In a text sequence, a "time step" would be the next word in a sequence of words.
C) The looping in convolutional neural networks enables them to learn and remember relationships among the data in the sequence.
D) The word "good" on its own has positive sentiment. However, when preceded by "not," which appears earlier in the sequence, the sentiment becomes negative.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
68
Which of the following statements is false?

A) The IMDb movie reviews dataset included with Keras contains 25,000 training samples and 25,000 testing samples, each labeled with its positive (1) or negative (0) sentiment.
B) The following code imports the xe "modules:tensorflow.keras.datasets"xe "tensorflow.keras.datasets module"tensorflow.keras.datasets.imdb module so we can load the dataset:
From tensorflow.keras.datasets import imdb
C) The imdb module's load_data function returns the IMDb training and testing sets. The load_data function enables you to specify the number of unique words to import as part of the training and testing data. The following code loads only the top 10,000 most frequently occurring words:
Number_of_words = 10000
(X_train, y_train), (X_test, y_test) = imdb.load_data(
Num_words=number_of_words)
D) The load_data call in Part (c) returns a tuple of two elements containing the samples and labels, respectively.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
69
Which of the following statements a), b) or c) is false?

A) Assuming the IMDb training set samples, training set labels, testing set samples and testing set labels are stored in X_train, y_train, X_test, and y_test, respectively, the following code snippets check their dimensions:
[4]: X_train.shape
[4]: (25000,)
[5]: y_train.shape
[5]: (25000,)
[6]: X_test.shape
[6]: (25000,)
[7]: y_test.shape
[7]: (25000,)
B) The arrays y_train and X_test are one-dimensional arrays containing 1s and 0s, indicating whether each review is positive or negative.
C) Based on the outputs from the snippets in Part (a), X_train and X_test appear to be one-dimensional. However, their elements actually are lists of integers, each representing one review's contents, as shown in the code below:
[8]: %pprint
[8]: Pretty printing has been turned OFF
[9]: X_train[123]
[9]: [1, 307, 5, 1301, 20, 1026, 2511, 87, 2775, 52, 116, 5, 31, 7, 4, 91, 1220, 102, 13, 28, 110, 11, 6, 137, 13, 115, 219, 141, 35, 221, 956, 54, 13, 16, 11, 2714, 61, 322, 423, 12, 38, 76, 59, 1803, 72, 8, 2, 23, 5, 967, 12, 38, 85, 62, 358, 99]
D) All of the above statements are true:
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
70
A Keras model's ________ method returns the loss and accuracy values of a trained model.

A) assess
B) account
C) grade
D) evaluate
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
71
Which of the following statements about the IMDb movie reviews dataset a), b) or c) is false?

A) The number of words per review varies, but the Keras requires all samples to have the same dimensions.
B) To use the IMDb dataset for deep learning, we need to restrict every review to the same number of words.
C) When performing the data preparation in Part (b), some reviews will need to be padded with additional data and others will need to be truncated.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
72
Which of the following statements a), b) or c) is false?

A) RNNs for text sequences take into account the relationships among the earlier and later parts of a sequence.
B) When determining the meaning of text there can be many words to consider and an arbitrary number of words in between them.
C) A Long Short-Term Memory (LSTM) layer makes a neural network convolutional and is optimized to handle learning from sequences.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
73
Which of the following statements a), b) or c) is false?

A) We've used xe "one-hot encoding[one hot encoding]"one-hot encoding to convert the MNIST dataset's integer labels into xe "categorical data"categorical data. The result for each label was a vector in which all but one element was 0. We could also do that for the index values that represent the words in the IMDb dataset.
B) For our IMDb example that processes 10,000 unique words, we'd need a 10,000-by-10,000 array to represent all the words. That's 100,000,000 elements, and almost all the array elements would be 0. This is not an efficient way to encode the data.
C) If we were to process all 88,000+ unique words in the IMDb dataset, we'd need an array of nearly eight billion elements.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
74
Which of the following statements a), b) or c) is false?

A) To xe "reduce dimensionality"reduce ambiguity, RNNs that process text sequences typically begin with an embedding layer that encodes each word in a compact xe "dense-vector representation"dense-vector representation.
B) The vectors produced by the embedding layer also capture the word's context-that is, how a given word relates to the words around it.
C) An embedding layer enables the RNN to learn word relationships among the training data.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
75
The ________ activation function, which is preferred for xe "binary classification"binary classification, reduces arbitrary values into the range 0.0-1.0, producing a probability.

A) softmax
B) relu
C) sigmoid
D) softplus
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
76
Which of the following statements a), b) or c) is false regarding decoding IMDb movie reviews?

A) The following snippet gets the word-to-index dictionary by calling the function get_word_index from the tensorflow.keras.datasets.imdb module:
[10]: word_to_index = imdb.get_word_index()
B) The word 'great' might appear in a positive movie review, so the following code checks whether it's in the dictionary:
[11]: word_to_index['great']
[11]: 84
C) According to the Part (b) output, 'great' is the dataset's 84th most frequent word. If you use an expression like the one in Part (b) to look up a word that's not in the dictionary, you'll get an exception.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 76 flashcards in this deck.