Mastering TensorFlow 1.x
上QQ阅读APP看书,第一时间看更新

TFLearn

TFLearn is a modular library in Python that is built on top of core TensorFlow.

TFLearn is different from the TensorFlow Learn package which is also known as TF Learn (with one space in between TF and Learn). TFLearn is available at the following link: http://tflearn.org, and the source code is available on GitHub at the following link: https://github.com/tflearn/tflearn.

TFLearn can be installed in Python 3 with the following command:

pip3 install tflearn

To install TFLearn in other environments or from source, please refer to the following link: http://tflearn.org/installation/.

The simple workflow in TFLearn is as follows:

  1. Create an input layer first.
  2. Pass the input object to create further layers.
  3. Add the output layer.
  4. Create the net using an estimator layer such as regression.
  5. Create a model from the net created in the previous step.
  6. Train the model with the model.fit() method.
  7. Use the trained model to predict or evaluate.