Similar to the TensorFlow Python API, by Google, TensorFlow for Scala provides multiple APIs. The lowest level API – Core API – provides you with complete programming control. the core API is suitable for machine learning researchers and others who require fine levels of control over their models. The higher level APIs are built on top of the Core API. These higher level APIs are typically easier to learn and use. In addition, the higher level APIs make repetitive tasks easier and more consistent between different users. A high-level API like the Learn API helps you manage datasets, models, (distributed) training, and inference.

The main APIs of TensorFlow Scala are the following:

The fact that this library is statically-typed is mentioned a couple times in the above paragraph and that’s because it is a very important feature. It means that many problems with the code you write will show themselves at compile time, which means that your chances of running into the experience of waiting for a neural network to train for a week only to find out that your evaluation code crashed and you lost everything, decrease significantly.

It is recommended to first go through the Tensors guide, and then go from high-level to low-level concepts as you progress (i.e., read through the High-Level Learning guide first and then through the Graph Construction guide). Concepts such as the TensorFlow graph and sessions only appear in the Graph Construction guide.

Relationship to the TensorFlow Python API

These guides borrow a lot of material from the official Python API documentation of TensorFlow and adapt it for the purposes of TensorFlow Scala. They also introduce a lot of new constructs specific to this library.