NEW
Font size
WorksheetsIntroduction to Artificial Neural Networks with Keras
Total questions: 56
Worksheet time: 28mins
Which statement best defines an Artificial Neural Network (ANN)?
A biological brain replica running on hardware
A rule-based system with fixed symbolic logic
A database of features learned from labeled data
An information processing paradigm inspired by neurons
What is Keras primarily used for in deep learning workflows?
Replacing datasets with synthetic data generators
Building models on top of TensorFlow or Theano
Serving predictions from web servers only
Designing custom CPUs for training models
In a Multi-layer Perceptron (MLP), what is the role of hidden layers?
Store labels for training samples
Act as output encoders for predictions
Provide random noise to regularize weights
Transform inputs through learned representations
Which learning technique is typically used by MLPs to update weights?
Reinforcement learning with policy gradients
Supervised learning using backpropagation
Unsupervised clustering with k-means
Genetic algorithms with crossover operations
Which task is MOST suitable for an MLP according to the material?
Image compression without labels
Time series prediction with supervision
Sorting numbers using bubble sort
Lossless audio encoding pipelines
Identify the correct layer order in a standard MLP.
Output, hidden, input
Hidden, output, input
Input, output, hidden
Input, hidden, output
For a regression problem, which output configuration is often used in an MLP?
Two neurons with tanh activation
Many neurons with ReLU activation
A single neuron with no activation
Multiple neurons with softmax activation
Why does increasing hidden layers sometimes improve an MLP's performance?
It reduces dataset size automatically
It removes the need for activation functions
It guarantees zero training error
It enables deeper feature transformations
Which function is used to split arrays into training and test sets in a typical Keras workflow using scikit-learn?
fit_transform from numpy
train_test_split from sklearn
split_dataset from TensorFlow
model.evaluate from Keras
Given a dataset with 891 rows and five columns where column 0 is the binary target, which slice selects X features correctly?
dataset[:,0] for X
dataset[:,:] for X
dataset[:,1:5] for X
dataset[1:5,:] for X
You need a first Dense layer for four input features with ReLU. Which Keras line is appropriate?
Dense(32, input_dim=4, activation='relu')
Dense(32, activation='sigmoid')
Dense(1, input_dim=4, activation='relu')
Dense(4, input_dim=32, activation='relu')
What is the primary purpose of adding Dropout layers with rate 0.2 during training?
Increase model capacity by adding neurons
Prevent overfitting by randomly disabling inputs
Speed up inference by caching activations
Normalize features before first dense layer
For binary classification with labels 0 and 1, which output configuration is most appropriate?
Two output neurons with softmax activation
One output neuron with sigmoid activation
One output neuron with relu activation
Three output neurons with tanh activation
Which compile configuration correctly matches a binary classification model trained with Keras?
loss='binary_crossentropy', optimizer='adam', metrics=['accuracy']
loss='categorical_crossentropy', optimizer='adam', metrics=['recall']
loss='hinge', optimizer='rmsprop', metrics=['mae']
loss='mse', optimizer='sgd', metrics=['precision']
A training set has 623 samples and batch_size=10. Approximately how many batches per epoch are processed?
64 batches per epoch
63 batches per epoch
60 batches per epoch
62 batches per epoch
In a Sequential model with Dense layers of sizes 32, 16, 8, and 4 using ReLU, what is a plausible reason to progressively reduce neuron counts?
To increase the learning rate each layer
To ensure optimizer uses momentum
To guarantee zero training loss
To create a funnel for feature abstraction
Which printed metrics are returned by model.evaluate(x_test, y_test, verbose=0) in the shown example?
Learning rate and gradient norms
F1 score and ROC AUC
Loss and accuracy values
Precision and recall percentages
Why is random_state set when calling train_test_split?
To fix the number of epochs during fit
To assign class weights automatically
To make the split reproducible across runs
To scale features to zero mean
Which activation should be used in a multi-class output layer where each class needs its probability?
ReLU activation for all neurons
Linear activation without constraints
Sigmoid activation for each neuron
Softmax activation across neurons
TensorFlow supports training across multiple machines and GPUs. What key benefit does this provide for deep learning workflows?
Eliminates need for optimizers completely
Allows larger models and faster training
Removes requirement for labeled data
Prevents any overfitting automatically
Which Python versions are listed as prerequisites for TensorFlow 2 on Windows in this guide?
Python 3.5–3.7
Python 3.8–3.10
Python 3.6–3.8
Python 3.7–3.9
What Windows edition is shown as a valid target when selecting the CUDA Toolkit installer?
Windows XP
Windows 10
Windows 8
Windows 11
For TensorFlow 2.5.0, which CUDA version is indicated in the compatibility table?
CUDA 11.4
CUDA 11.2
CUDA 10.2
CUDA 10.0
During CUDA installation, which option is recommended on the NVIDIA installer screen?
Custom (Developer)
Express (Recommended)
Silent (No UI)
Minimal (Quick)
Which build tool version appears in the compatibility table for TensorFlow 2.5.0?
CMake 3.18.4
Bazel 3.7.2
Ninja 1.10.0
Make 4.3
What step precedes installing the NVIDIA CUDA Toolkit in the Windows setup sequence?
Download Microsoft Visual Studio
Install cuDNN first
Configure PATH variables
Install Anaconda first
Which compiler version is shown alongside TensorFlow 2.5.0 in the table?
MSVC 19.28
Clang 12.0
GCC 7.3.1
ICC 19.0
Where are students directed to download cuDNN in the instructions?
tensorflow.org/cudnn
NVIDIA GeForce site
github.com/nvidia/cudnn
developer.nvidia.com/cudnn
When choosing a CUDA installer, which architecture is selected for Windows?
ARM64
RISC-V
x86_64
IA-32
Which visualization library is mentioned as supported by the newest TensorFlow release?
seaborn
bokeh
matplotlib
plotly
Which three cuDNN folders are copied into the NVIDIA GPU Computing Toolkit CUDA directory during setup?
bin, include, lib
cfg, modules, scripts
src, docs, tests
temp, cache, logs
After copying cuDNN files, which specific path should be added to the system PATH to enable CUDA binaries?
C:\Users\Public\Documents
C:\Windows\System32\drivers
C:\Program Files\Common Files
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin
In System Properties, which button opens the dialog for editing PATH environment variables?
Device Manager...
System Restore...
Performance Options...
Environment Variables...
When editing PATH, which action adds a new entry for a folder path?
Click Edit text and type name
Click Move Up to create entry
Click Delete then restart PC
Click New and paste the path
Which additional CUDA subfolder path must be added to PATH besides bin to avoid runtime errors?
examples
samples
assets
libnvvm
Which conda command creates a new environment for TensorFlow with a specific Python version?
python -m venv tf2.5-3.8
conda init tensorflow2.5 py3.8
pip install tensorflow==3.8 env
conda create --name tf2.5 python==3.8
What is the correct command to activate the newly created conda environment?
python activate tf2.5
conda start tf2.5
conda activate tf2.5
activate tf2.5 now
Why is restarting the PC recommended after updating PATH with CUDA folders?
Update PyCharm settings silently
Install GPU drivers automatically
Ensure environment changes reload
Remove temporary cuDNN files
Which dataset is used to train the simple PyTorch demo for handwritten digit classification?
MNIST handwritten digits dataset
CIFAR-10 color images dataset
ImageNet large-scale dataset
Fashion-MNIST apparel dataset
In the PyTorch setup shown, which library provides common vision datasets and transforms?
torchmetrics for evaluation utilities
torchvision for datasets and transforms
torchaudio for sound preprocessing
numpy for array manipulations
During environment testing, which output indicates the GPU library was initialized correctly?
GPU memory exceeded warning
successfully opened cuda(versioncode)
TensorFlow version mismatch error
CPU fallback activated message
Which Python package import checks whether TensorFlow was built with CUDA support?
tf.keras.mixed_precision.enable()
tf.test.is_gpu_available()
tf.test.is_built_with_cuda()
tf.config.list_physical_devices()
What is the primary role of the TensorFlow Data API described?
Designing neural network layers
Visualizing training metrics dashboards
Loading, preprocessing, and transforming data
Optimizing GPU kernel launches
Which transformation groups are explicitly mentioned as part of the TensorFlow Dataset pipeline?
repeat, batch, map, filter, shuffle
split, merge, stack, slice, tile
encode, decode, compress, decompress
pad, clip, normalize, standardize
Why is batching emphasized in the TensorFlow Data API overview?
It groups samples for efficient training
It reduces GPU precision settings
It prevents overfitting on validation
It converts text to TFRecord format
Which import line brings PyTorch’s optimization utilities into scope for the demo?
import torch.nn.optim as optim
from torchvision import optimizers
import torch.optim as opt
from torch import optim
The Data API handles implementation details like multithreading, queuing, batching, and prefetching. What is the main benefit for practitioners?
They eliminate dataset labeling steps
They replace GPUs with CPUs entirely
They avoid manual data pipeline plumbing
They can ignore model accuracy tuning
To verify TensorFlow GPU availability in code, which call should report TRUE when properly configured?
tf.test.is_gpu_available(cuda_only=False)
tf.config.experimental.enable_tensor_float_32()
tf.keras.backend.clear_session()
tf.debugging.set_log_device_placement(True)
Which method converts a tensor X into a Dataset of its elements?
tf.data.Dataset.shuffle(X) call
tf.data.Dataset.from_tensor_slices(X)
tf.data.Dataset.range(X) function
tf.data.Dataset.batch(X) method
When iterating over tf.data.Dataset.range(10), what values are yielded?
Pairs of index and value
Random integers up to ten
Batches of size ten
Scalars from 0 through 9
What does dataset.repeat(3).batch(7) produce from range(10)?
Batches shuffled automatically
Unbatched repeated stream
Three epochs then 7-sized batches
Seven epochs then 3-sized batches
Which transformation applies a function to each element of a dataset?
filter() keeps matching items
batch() groups items
map() transforms items
shuffle() randomizes order
Given dataset.map(lambda x: x * 2) on range(10), which first batch element appears after repeat(3).batch(7)?
Sequence starting 0 2 4 6
Sequence starting 1 3 5 7
Sequence starting 0 1 2 3
Sequence starting 2 4 6 8
What is the effect of dataset.filter(lambda x: x < 10) on a dataset of integers?
Removes values equal to ten
Keeps values less than ten
Maps values to ten
Batches values into tens
In shuffle(buffer_size=3, seed=42), why is buffer_size important?
Controls data type casting
Determines batching stride
Limits reservoir for randomization
Sets number of repeats
Which sequence of chained calls correctly creates, repeats, maps, filters, shuffles, and batches?
from_tensor_slices → repeat → map → filter → shuffle → batch
range → batch → shuffle → filter → map → repeat
from_tensor_slices → filter → batch → repeat → shuffle → map
range → shuffle → repeat → from_tensor_slices → map → batch
