Solving linear equations

TensorFlow can solve a series of linear equations using the solve operation. Let's first explain this without using the library and later use the solve function.

A linear equation is represented as follows:

ax + b = yy - ax = b

y - ax = b

y/b - a/b(x) = 1

Our job is to find the values for a and b in the preceding equation, given our observed points. First, create the matrix points. The first column represents x values, while the second column represents y values. Consider that X is the input matrix and A is the parameters that we need to learn; we set up a system like AX=B, therefore, . The following example, with code, ...

Get Neural Network Programming with TensorFlow 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.