Book Image

Getting Started with TensorFlow

By : Giancarlo Zaccone
Book Image

Getting Started with TensorFlow

By: Giancarlo Zaccone

Overview of this book

<p>Google's TensorFlow engine, after much fanfare, has evolved in to a robust, user-friendly, and customizable, application-grade software library of machine learning (ML) code for numerical computation and neural networks.</p> <p>This book takes you through the practical software implementation of various machine learning techniques with TensorFlow. In the first few chapters, you'll gain familiarity with the framework and perform the mathematical operations required for data analysis. As you progress further, you'll learn to implement various machine learning techniques such as classification, clustering, neural networks, and deep learning through practical examples.</p> <p>By the end of this book, you’ll have gained hands-on experience of using TensorFlow and building classification, image recognition systems, language processing, and information retrieving systems for your application.</p>
Table of Contents (12 chapters)

Loading and exporting a TensorFlow model


The C++ code for loading the exported TensorFlow model is in the main() function in mnist_inference.cc. Here we report an excerpt; we do not consider the parameters for batching. If you want to adjust the maximum batch size, timeout threshold, or the number of background threads used for batched inference, you can do so by setting more values in BatchingParameters:

int main(int argc, char** argv) 
{
  SessionBundleConfig session_bundle_config;
          . . . Here batching parameters 
  std::unique_ptr<SessionBundleFactory> bundle_factory;
  TF_QCHECK_OK(
      SessionBundleFactory::Create(session_bundle_config,  
                                       &bundle_factory));
      std::unique_ptr<SessionBundle> bundle(new SessionBundle);
      TF_QCHECK_OK(bundle_factory->CreateSessionBundle(bundle_path,
                                                          &bundle));
      ......
      RunServer(FLAGS_port, std::move(bundle...