liveBook · Manning

TensorFlow

As explained in Distributed Machine Learning Patterns

An open-source platform for numerical computation and machine learning, including tools for building and training neural networks.

TensorFlow is an end-to-end machine-learning platform used here to process data, build models, train and evaluate them, and support a broader distributed ML workflow. Its portability across hardware and multilanguage support make it an implementation anchor rather than the distributed infrastructure itself. section 8.0 section 8.1

A practical local workflow starts with a Python environment, installs TensorFlow, loads MNIST through tf.keras, and separates training and test arrays. The handwritten-digit images are normalized from uint8 values in the 0–255 range to floating-point values from 0 to 1 before training. section 8.1.1 section 8.1.1

With the high-level tf.keras API, a typical model workflow is:

  • Define a Sequential network with Flatten, Dense, Dropout, and softmax output layers. section 8.1.1
  • Compile it with an optimizer, loss function, and accuracy metric. section 8.1.1
  • Train on labeled examples, then evaluate against held-out test data. section 8.1.1
  • Save the trained model and reload it when needed. section 8.1.1

MNIST image classification

A 28×28 grayscale handwritten-digit classifier flattens each image, uses a 128-unit ReLU hidden layer with dropout, and predicts one of 10 classes with softmax. After five epochs, the shown run reports roughly 97.6% test accuracy. A second workflow uses Keras Tuner Hyperband to search hidden-unit counts and learning rates, with EarlyStopping monitoring validation loss. section 8.1.1 section 8.1.1

TensorFlow fits into a pipeline with distinct operational responsibilities: Kubernetes supplies the distributed environment, Kubeflow submits distributed training jobs, and Argo Workflows defines and submits the end-to-end workflow. TensorFlow Serving is the selected production-serving component; related ecosystem projects also target browsers, edge devices, reusable trained models, and production pipelines. section 8.0 section 8.1

Table 1.1 The technologies covered in this book and their uses (view table figure)

Technology

Use

TensorFlow

Building machine learning and deep learning models

Kubernetes

Managing distributed environments and resources

Kubeflow

Submitting and managing distributed training jobs easily on Kubernetes clusters

Argo Workflows

Defining, orchestrating, and managing workflows

Docker

Building and managing images to be used for starting containerized environments

Compare TensorFlow’s model-building role with the separate infrastructure, job-management, workflow-orchestration, and container-image roles in a distributed ML system. section 1.4

How Distributed Machine Learning Patterns covers it

How deep it goes
Works through installation, MNIST preprocessing, Sequential training, persistence, and hyperparameter tuning without covering distributed TensorFlow execution.
Examples
Demonstrates MNIST digit classification, model saving and loading, and Hyperband tuning with EarlyStopping.
What it assumes
Assumes basic Python-based model-building experience and some production ML exposure; distributed-systems experience is not required.
What you can do after
Apply it via tf.keras to preprocess data, train and evaluate a local classifier, persist it, and tune selected hyperparameters.
How it connects
Connects TensorFlow to Keras, Kubernetes, Kubeflow, Argo Workflows, TensorFlow Serving, and Keras Tuner.

Also explained in

Compare how 4 books explain TensorFlow →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Distributed Machine Learning Patterns. The section links point to the parts of the book it draws on.