All Flashcards
What is TensorFlow?
TensorFlow is an open-source, high-performance library for numerical computation, any numerical computation, not just for machine learning.
It is a scalable and multi-platform programming interface for implementing and running machine learning algorithms, including convenience wrappers for deep learning.
What is Tensor?
It is an N-dimensional array.
What tf.GradientTape is used for?
TensorFlow records all operations executed inside the context of tf.GradientTape onto a tape
How does TensorFlow represent numeric computations?
Using a Directed Acyclic Graph (or DAG)
Which API is used to build performant, complex input pipelines from simple, re-usable pieces that will feed your model’s training or evaluation loops.
tf.data.Dataset
What is tf.data API ?
- The tf.data API introduces the tf.data.Dataset abstraction that represents a sequence of elements, in which each element consists of one or more components. For example, in an image pipeline.
- The dataset API will help you create input functions for your model that load data in progressively, throttling it.
Why are there two functions for mapping, map and flat_map?
One of them is to simple do a one-for-one transformation and the other one is one-to-many transformations.
What prefetching allows you to do?
Prefetching allows for subsequent batches to be prepared as soon as their previous batches have been sent away for computation.
How to increase speed of processing in TensorFlow?
By combining prefetching and multi-threaded loading and preprocessing, you can achieve a very good performance by making sure that each of your GPUs or CPUs are constantly busy.
How categorical columns are represented in TensorFlow?
Categorical columns are represented in TensorFlow as sparse tensors.
What embedding vectors are used for?
As the number of categories of a feature grows large, it becomes infeasible to train a neural network using one-hot encodings. Use an embedding column to overcome this limitation.
What are the purposes of embedding vectors?
- finding nearest neighbors in the embedding space
- as input into a machine learning model for a supervised task
- for visualization of concepts and relations between categories (can use TensorBoard)
What Keras preprocessing API is for?
- Combined with TensorFlow, the Keras preprocessing layers API allows TensorFlow developers to build Keras native input processing pipelines.
- With Keras preprocessing layers, you can build and export models that are truly end-to-end.
List available preprocessing layers in Keras.
The available preprocessing layers include
- text preprocessing,
- numerical features preprocessing,
- categorical features preprocessing
- image preprocessing
- image data augmentation
Wich Keras preprocessing layers are used for categorical values?
- Tf.keras.layers.CategoryEncoding
- Tf.keras.layers.Hashing
- Tf.keras.layers.StringLookup
- Tf.keras.layers.IntegerLookup
What Tf.keras.layers.IntegerLookup does?
It urns integer categorical values into an encoded representation that can be read by an Embedding layer or a Dense layer.
What Tf.keras.layers.StringLookup does?
It turns string categorical values into an encoded representation that can be read by an Embedding layer or a Dense layer.
What Tf.keras.layers.Hashing does?
It performs categorical feature hashing, also known as “the hashing trick.”
What Tf.keras.layers.CategoryEncoding does?
It turns integer categorical features into one-hot, multi-hot, or count-dense representations.
What preprocessing layers support multiple states that are computed based on the dataset at the given time?
- TextVectorization (which holds a map between string tokens and integer indices)
- StringLookup and IntegerLookup (which holds a mapping between input values and integer indices)
- Normalization (which holds the mean and standard deviation of the features)
- Discretization (which holds information about the value bucket boundaries)
Note
These layers are nontrainable
What does it mean that layers are nontrainable?
Their state is not set during training. It must be set before training, either by initializing them, from a precomputed constant, or by adapting them on data.