How it works...

Unlike prior recipes, or most recipes in this book, the solution here is found only through matrix operations. Most TensorFlow algorithms that we will use are implemented via a training loop and take advantage of automatic backpropagation to update model variables. Here, we illustrate the versatility of TensorFlow by implementing a direct solution to fitting a model to data.

We have used a two-dimensional data example here to show the plot of the fit with the data. It is important to note that the formula used for solving the coefficients, , will scale to as many features in the data as needed (barring any co-linearity issues). ...

Get TensorFlow Machine Learning Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.