TensorFlow models
In this section, we will use TensorFlow to build some machine learning models. First, we will build a simple linear regression model and then a convolutional neural network model, similar to what we have seen in Chapter 5, Image Classification Using Convolutional Neural Networks.
The following code loads the TensorFlow library. We can confirm it loaded successfully by setting and accessing a constant string value:
> library(tensorflow) # confirm that TensorFlow library has loaded > sess=tf$Session() > hello_world <- tf$constant('Hello world from TensorFlow') > sess$run(hello_world) b'Hello world from TensorFlow'
Linear regression using TensorFlow
In this first Tensorflow example, we will look at regression. The code for this section is in the Chapter8/regression_tf.R
 folder:
- First, we create some fake data for an an input value, x, and an output value, y. We set y to be approximately equal to
0.8 + x * 1.3
. We want the application to discover thebeta0
 andbeta1...