Practical examples
In this section, we provide a practical problem that can be solved using a neural network. We will introduce the problems and build our neural network model using TensorFlow to solve the problems.
TensorFlow setup and key concepts
We recommend readers follow the instructions at https://www.tensorflow.org/install/ to install TensorFlow. We will use Python as our programming language. There are mainly three key concepts that are used in the code sample:
- Tensor: Tensor is the central data unit in TensorFlow. We may think of it as a matrix of any number of dimensions. The entries within the tensor are primitive values. For example, see the following:
5 is a scalar and a rank 0 tensor [[0, 1, 2], [3, 4, 5]] is a matrix with shape [2, 3] and a rank 2 tensor
- TensorFlow session: A TensorFlow session encapsulates the control and state of the TensorFlow runtime.
- Computation graph: A set of TensorFlow operations that are arranged into a computation graph of nodes. The edges of the graph...