...

Artificial Intelligence - Tensorflow

Back to Course

Lesson Description


Lession - #1056 Tensorflow TFn and it's installation


TFLearn can be characterized as a particular and straightforward profound learning perspective utilized in TensorFlow structure. The fundamental intention of TFLearn is to give a more elevated level API to TensorFlow for working with and appearing new trials.

Think about the accompanying significant highlights of TFLearn −

  • TFLearn is not difficult to utilize and comprehend.
  • It incorporates simple ideas to fabricate profoundly particular organization layers, analyzers and different measurements installed inside them.
  • It incorporates full straightforwardness with TensorFlow work framework.
  • It incorporates strong assistant capacities to prepare the underlying tensors which acknowledge different information sources, results and analyzers.
  • It incorporates simple and delightful chart representation.
  • The diagram perception incorporates different subtleties of loads, slopes and actuations.

Install TFLearn by executing the accompanying order −


pip install tflearn



The following illustration shows the implementation of TFLearn with Random Forest classifier −


from __future__ import division, print_function, absolute_import

#TFLearn module implementation
import tflearn
from tflearn.estimators import RandomForestClassifier

# Data loading and pre-processing with respect to dataset
import tflearn.datasets.mnist as mnist
X, Y, testX, testY = mnist.load_data(one_hot = False>
m = RandomForestClassifier(n_estimators = 100, max_nodes = 1000>
m.fit(X, Y, batch_size = 10000, display_step = 10>
print("Compute the accuracy on train data:">
print(m.evaluate(X, Y, tflearn.accuracy_op>
>
print("Compute the accuracy on test set:">
print(m.evaluate(testX, testY, tflearn.accuracy_op>
>
print("Digits for test images id 0 to 5:">
print(m.predict(testX[:5]>
>
print("True digits:">
print(testY[:5]>