wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Introduction to Artificial Neural Networks with Keras

Total questions: 56

Worksheet time: 28mins

Name
Class
Date
1.

Which statement best defines an Artificial Neural Network (ANN)?

a)

A biological brain replica running on hardware

b)

A rule-based system with fixed symbolic logic

c)

A database of features learned from labeled data

d)

An information processing paradigm inspired by neurons

2.

What is Keras primarily used for in deep learning workflows?

a)

Replacing datasets with synthetic data generators

b)

Building models on top of TensorFlow or Theano

c)

Serving predictions from web servers only

d)

Designing custom CPUs for training models

3.

In a Multi-layer Perceptron (MLP), what is the role of hidden layers?

a)

Store labels for training samples

b)

Act as output encoders for predictions

c)

Provide random noise to regularize weights

d)

Transform inputs through learned representations

4.

Which learning technique is typically used by MLPs to update weights?

a)

Reinforcement learning with policy gradients

b)

Supervised learning using backpropagation

c)

Unsupervised clustering with k-means

d)

Genetic algorithms with crossover operations

5.

Which task is MOST suitable for an MLP according to the material?

a)

Image compression without labels

b)

Time series prediction with supervision

c)

Sorting numbers using bubble sort

d)

Lossless audio encoding pipelines

6.

Identify the correct layer order in a standard MLP.

a)

Output, hidden, input

b)

Hidden, output, input

c)

Input, output, hidden

d)

Input, hidden, output

7.

For a regression problem, which output configuration is often used in an MLP?

a)

Two neurons with tanh activation

b)

Many neurons with ReLU activation

c)

A single neuron with no activation

d)

Multiple neurons with softmax activation

8.

Why does increasing hidden layers sometimes improve an MLP's performance?

a)

It reduces dataset size automatically

b)

It removes the need for activation functions

c)

It guarantees zero training error

d)

It enables deeper feature transformations

9.

Which function is used to split arrays into training and test sets in a typical Keras workflow using scikit-learn?

a)

fit_transform from numpy

b)

train_test_split from sklearn

c)

split_dataset from TensorFlow

d)

model.evaluate from Keras

10.

Given a dataset with 891 rows and five columns where column 0 is the binary target, which slice selects X features correctly?

a)

dataset[:,0] for X

b)

dataset[:,:] for X

c)

dataset[:,1:5] for X

d)

dataset[1:5,:] for X

11.

You need a first Dense layer for four input features with ReLU. Which Keras line is appropriate?

a)

Dense(32, input_dim=4, activation='relu')

b)

Dense(32, activation='sigmoid')

c)

Dense(1, input_dim=4, activation='relu')

d)

Dense(4, input_dim=32, activation='relu')

12.

What is the primary purpose of adding Dropout layers with rate 0.2 during training?

a)

Increase model capacity by adding neurons

b)

Prevent overfitting by randomly disabling inputs

c)

Speed up inference by caching activations

d)

Normalize features before first dense layer

13.

For binary classification with labels 0 and 1, which output configuration is most appropriate?

a)

Two output neurons with softmax activation

b)

One output neuron with sigmoid activation

c)

One output neuron with relu activation

d)

Three output neurons with tanh activation

14.

Which compile configuration correctly matches a binary classification model trained with Keras?

a)

loss='binary_crossentropy', optimizer='adam', metrics=['accuracy']

b)

loss='categorical_crossentropy', optimizer='adam', metrics=['recall']

c)

loss='hinge', optimizer='rmsprop', metrics=['mae']

d)

loss='mse', optimizer='sgd', metrics=['precision']

15.

A training set has 623 samples and batch_size=10. Approximately how many batches per epoch are processed?

a)

64 batches per epoch

b)

63 batches per epoch

c)

60 batches per epoch

d)

62 batches per epoch

16.

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?

a)

To increase the learning rate each layer

b)

To ensure optimizer uses momentum

c)

To guarantee zero training loss

d)

To create a funnel for feature abstraction

17.

Which printed metrics are returned by model.evaluate(x_test, y_test, verbose=0) in the shown example?

a)

Learning rate and gradient norms

b)

F1 score and ROC AUC

c)

Loss and accuracy values

d)

Precision and recall percentages

18.

Why is random_state set when calling train_test_split?

a)

To fix the number of epochs during fit

b)

To assign class weights automatically

c)

To make the split reproducible across runs

d)

To scale features to zero mean

19.

Which activation should be used in a multi-class output layer where each class needs its probability?

a)

ReLU activation for all neurons

b)

Linear activation without constraints

c)

Sigmoid activation for each neuron

d)

Softmax activation across neurons

20.

TensorFlow supports training across multiple machines and GPUs. What key benefit does this provide for deep learning workflows?

a)

Eliminates need for optimizers completely

b)

Allows larger models and faster training

c)

Removes requirement for labeled data

d)

Prevents any overfitting automatically

21.

Which Python versions are listed as prerequisites for TensorFlow 2 on Windows in this guide?

a)

Python 3.5–3.7

b)

Python 3.8–3.10

c)

Python 3.6–3.8

d)

Python 3.7–3.9

22.

What Windows edition is shown as a valid target when selecting the CUDA Toolkit installer?

a)

Windows XP

b)

Windows 10

c)

Windows 8

d)

Windows 11

23.

For TensorFlow 2.5.0, which CUDA version is indicated in the compatibility table?

a)

CUDA 11.4

b)

CUDA 11.2

c)

CUDA 10.2

d)

CUDA 10.0

24.

During CUDA installation, which option is recommended on the NVIDIA installer screen?

a)

Custom (Developer)

b)

Express (Recommended)

c)

Silent (No UI)

d)

Minimal (Quick)

25.

Which build tool version appears in the compatibility table for TensorFlow 2.5.0?

a)

CMake 3.18.4

b)

Bazel 3.7.2

c)

Ninja 1.10.0

d)

Make 4.3

26.

What step precedes installing the NVIDIA CUDA Toolkit in the Windows setup sequence?

a)

Download Microsoft Visual Studio

b)

Install cuDNN first

c)

Configure PATH variables

d)

Install Anaconda first

27.

Which compiler version is shown alongside TensorFlow 2.5.0 in the table?

a)

MSVC 19.28

b)

Clang 12.0

c)

GCC 7.3.1

d)

ICC 19.0

28.

Where are students directed to download cuDNN in the instructions?

a)

tensorflow.org/cudnn

b)

NVIDIA GeForce site

c)

github.com/nvidia/cudnn

d)

developer.nvidia.com/cudnn

29.

When choosing a CUDA installer, which architecture is selected for Windows?

a)

ARM64

b)

RISC-V

c)

x86_64

d)

IA-32

30.

Which visualization library is mentioned as supported by the newest TensorFlow release?

a)

seaborn

b)

bokeh

c)

matplotlib

d)

plotly

31.

Which three cuDNN folders are copied into the NVIDIA GPU Computing Toolkit CUDA directory during setup?

a)

bin, include, lib

b)

cfg, modules, scripts

c)

src, docs, tests

d)

temp, cache, logs

32.

After copying cuDNN files, which specific path should be added to the system PATH to enable CUDA binaries?

a)

C:\Users\Public\Documents

b)

C:\Windows\System32\drivers

c)

C:\Program Files\Common Files

d)

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin

33.

In System Properties, which button opens the dialog for editing PATH environment variables?

a)

Device Manager...

b)

System Restore...

c)

Performance Options...

d)

Environment Variables...

34.

When editing PATH, which action adds a new entry for a folder path?

a)

Click Edit text and type name

b)

Click Move Up to create entry

c)

Click Delete then restart PC

d)

Click New and paste the path

35.

Which additional CUDA subfolder path must be added to PATH besides bin to avoid runtime errors?

a)

examples

b)

samples

c)

assets

d)

libnvvm

36.

Which conda command creates a new environment for TensorFlow with a specific Python version?

a)

python -m venv tf2.5-3.8

b)

conda init tensorflow2.5 py3.8

c)

pip install tensorflow==3.8 env

d)

conda create --name tf2.5 python==3.8

37.

What is the correct command to activate the newly created conda environment?

a)

python activate tf2.5

b)

conda start tf2.5

c)

conda activate tf2.5

d)

activate tf2.5 now

38.

Why is restarting the PC recommended after updating PATH with CUDA folders?

a)

Update PyCharm settings silently

b)

Install GPU drivers automatically

c)

Ensure environment changes reload

d)

Remove temporary cuDNN files

39.

Which dataset is used to train the simple PyTorch demo for handwritten digit classification?

a)

MNIST handwritten digits dataset

b)

CIFAR-10 color images dataset

c)

ImageNet large-scale dataset

d)

Fashion-MNIST apparel dataset

40.

In the PyTorch setup shown, which library provides common vision datasets and transforms?

a)

torchmetrics for evaluation utilities

b)

torchvision for datasets and transforms

c)

torchaudio for sound preprocessing

d)

numpy for array manipulations

41.

During environment testing, which output indicates the GPU library was initialized correctly?

a)

GPU memory exceeded warning

b)

successfully opened cuda(versioncode)

c)

TensorFlow version mismatch error

d)

CPU fallback activated message

42.

Which Python package import checks whether TensorFlow was built with CUDA support?

a)

tf.keras.mixed_precision.enable()

b)

tf.test.is_gpu_available()

c)

tf.test.is_built_with_cuda()

d)

tf.config.list_physical_devices()

43.

What is the primary role of the TensorFlow Data API described?

a)

Designing neural network layers

b)

Visualizing training metrics dashboards

c)

Loading, preprocessing, and transforming data

d)

Optimizing GPU kernel launches

44.

Which transformation groups are explicitly mentioned as part of the TensorFlow Dataset pipeline?

a)

repeat, batch, map, filter, shuffle

b)

split, merge, stack, slice, tile

c)

encode, decode, compress, decompress

d)

pad, clip, normalize, standardize

45.

Why is batching emphasized in the TensorFlow Data API overview?

a)

It groups samples for efficient training

b)

It reduces GPU precision settings

c)

It prevents overfitting on validation

d)

It converts text to TFRecord format

46.

Which import line brings PyTorch’s optimization utilities into scope for the demo?

a)

import torch.nn.optim as optim

b)

from torchvision import optimizers

c)

import torch.optim as opt

d)

from torch import optim

47.

The Data API handles implementation details like multithreading, queuing, batching, and prefetching. What is the main benefit for practitioners?

a)

They eliminate dataset labeling steps

b)

They replace GPUs with CPUs entirely

c)

They avoid manual data pipeline plumbing

d)

They can ignore model accuracy tuning

48.

To verify TensorFlow GPU availability in code, which call should report TRUE when properly configured?

a)

tf.test.is_gpu_available(cuda_only=False)

b)

tf.config.experimental.enable_tensor_float_32()

c)

tf.keras.backend.clear_session()

d)

tf.debugging.set_log_device_placement(True)

49.

Which method converts a tensor X into a Dataset of its elements?

a)

tf.data.Dataset.shuffle(X) call

b)

tf.data.Dataset.from_tensor_slices(X)

c)

tf.data.Dataset.range(X) function

d)

tf.data.Dataset.batch(X) method

50.

When iterating over tf.data.Dataset.range(10), what values are yielded?

a)

Pairs of index and value

b)

Random integers up to ten

c)

Batches of size ten

d)

Scalars from 0 through 9

51.

What does dataset.repeat(3).batch(7) produce from range(10)?

a)

Batches shuffled automatically

b)

Unbatched repeated stream

c)

Three epochs then 7-sized batches

d)

Seven epochs then 3-sized batches

52.

Which transformation applies a function to each element of a dataset?

a)

filter() keeps matching items

b)

batch() groups items

c)

map() transforms items

d)

shuffle() randomizes order

53.

Given dataset.map(lambda x: x * 2) on range(10), which first batch element appears after repeat(3).batch(7)?

a)

Sequence starting 0 2 4 6

b)

Sequence starting 1 3 5 7

c)

Sequence starting 0 1 2 3

d)

Sequence starting 2 4 6 8

54.

What is the effect of dataset.filter(lambda x: x < 10) on a dataset of integers?

a)

Removes values equal to ten

b)

Keeps values less than ten

c)

Maps values to ten

d)

Batches values into tens

55.

In shuffle(buffer_size=3, seed=42), why is buffer_size important?

a)

Controls data type casting

b)

Determines batching stride

c)

Limits reservoir for randomization

d)

Sets number of repeats

56.

Which sequence of chained calls correctly creates, repeats, maps, filters, shuffles, and batches?

a)

from_tensor_slices → repeat → map → filter → shuffle → batch

b)

range → batch → shuffle → filter → map → repeat

c)

from_tensor_slices → filter → batch → repeat → shuffle → map

d)

range → shuffle → repeat → from_tensor_slices → map → batch