09.05.2023 Views

pdfcoffee

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 2

5. Use tf.layers modules to combine predefined "lego bricks" whenever it

is possible, either with Sequential or Functional APIs, or with Subclassing.

Use Estimators if you need to have production-ready models, in particular

if these models need to scale on multiple GPUs, CPUs, or on multiple servers.

When needed, consider converting a tf.keras model into an Estimator.

6. Consider using a distribution strategy across GPUs, CPUs, and multiple

servers. With tf.keras it is easy.

Many other recommendations can be made but the preceding ones are the top six.

TensorFlow 2.x makes the initial learning step very easy and adopting tf.keras

makes it very easy for beginners.

The TensorFlow 2.x ecosystem

Today, TensorFlow 2.x is a rich learning ecosystem where, in addition to the core

learning engine, there is a large collection of tools that can be freely used.

In particular:

• TensorFlow.js (https://www.tensorflow.org/js) is a collection

of APIs to train and run inference directly in browsers or in Node.js.

• TensorFlow Lite (https://www.tensorflow.org/lite) is a lightweight

version of TensorFlow for embedded and mobile devices. Currently, both

Android and iOS are supported in Java and C++.

• TensorFlow Hub (https://www.tensorflow.org/hub) is a complete library

supporting the most common machine learning architectures. As of April

2019, Hub only partially supports the tf.Keras API but this issue (https://

github.com/tensorflow/tensorflow/issues/25362) is going to be solved

soon. We will see an example of Hub in Chapter 5, Advanced Convolutional

Neural Networks.

• TensorFlow Extended (TFX) (https://github.com/tensorflow/tfx) is a

complete end-to-end platform for learning, including tools for transformation

(TfTransform), analysis (TensorFlow Model Analysis), and for efficiently

serving learning models during inference (TensorFlow Serving). TFX

pipelines can be orchestrated using Apache Airflow and Kubeflow Pipelines.

• TensorBoard is a visual environment for inspecting, debugging, and

optimizing models and metrics.

• Sonnet is a library similar to Keras, developed by DeepMind for training

their models.

• TensorBoard Federated is a framework for machine learning and other

computations on decentralized data.

[ 81 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!