Book Image

TensorFlow Developer Certificate Guide

By : Oluwole Fagbohun
3 (1)
Book Image

TensorFlow Developer Certificate Guide

3 (1)
By: Oluwole Fagbohun

Overview of this book

The TensorFlow Developer Certificate Guide is an indispensable resource for machine learning enthusiasts and data professionals seeking to master TensorFlow and validate their skills by earning the certification. This practical guide equips you with the skills and knowledge necessary to build robust deep learning models that effectively tackle real-world challenges across diverse industries. You’ll embark on a journey of skill acquisition through easy-to-follow, step-by-step explanations and practical examples, mastering the craft of building sophisticated models using TensorFlow 2.x and overcoming common hurdles such as overfitting and data augmentation. With this book, you’ll discover a wide range of practical applications, including computer vision, natural language processing, and time series prediction. To prepare you for the TensorFlow Developer Certificate exam, it offers comprehensive coverage of exam topics, including image classification, natural language processing (NLP), and time series analysis. With the TensorFlow certification, you’ll be primed to tackle a broad spectrum of business problems and advance your career in the exciting field of machine learning. Whether you are a novice or an experienced developer, this guide will propel you to achieve your aspirations and become a highly skilled TensorFlow professional.
Table of Contents (20 chapters)
1
Part 1 – Introduction to TensorFlow
6
Part 2 – Image Classification with TensorFlow
12
Part 3 – Natural Language Processing with TensorFlow
15
Part 4 – Time Series with TensorFlow

LSTMs in time series forecasting

In the NLP sections, we discussed the capabilities of LSTMs and their improvements over RNNs by mitigating issues such as the vanishing gradient problem, enabling the model to learn longer sequences. In the context of time series forecasting, LSTM networks can be quite powerful. Let’s see how we can apply LSTMs to our sales dataset:

  1. Let’s begin by preparing our data:
    # Create sequences
    seq_len = 20
    X = []
    y = []
    for i in range(seq_len, len(data)):
        X.append(data[i-seq_len:i])
        y.append(data[i])
    X = np.array(X)
    X = X.reshape(X.shape[0], X.shape[1], 1)
    y = np.array(y)
    # Train/val split
    split = int(0.8*len(X))
    X_train, X_val = X[:split], X[split:]
    y_train, y_val = y[:split], y[split:]
    # Set batch size and buffer size
    batch_size = 64
    buffer_size = 1000
    # Create dataset
    dataset = tf.data.Dataset.from_tensor_slices(
        (X_train, y_train))
    dataset = dataset.shuffle(
        ...