开发手册 欢迎您!
软件开发者资料库

TensorFlow - TFLearn及其安装

TFLearn及其安装 - 从简单和简单的步骤学习TensorFlow,从基本到高级概念,包括简介,安装,理解人工智能,数学基础,机器学习和深度学习,基础知识,卷积神经网络,递归神经网络,TensorBoard可视化,单词嵌入,单层感知器,线性回归,TFLearn及其安装,CNN和RNN差异,Keras,分布式计算,TensorFlow导出,多层感知器学习,感知器隐藏层,TensorFlow中的优化器,XOR实现,梯度下降优化,形成图,使用TensorFlow的图像识别,神经网络训练的建议。

TFLearn可以定义为TensorFlow框架中使用的模块化和透明的深度学习方面. TFLearn的主要动机是为TensorFlow提供更高级别的API,以促进和展示新的实验.

考虑TFLearn : 的以下重要特征;

  • TFLearn易于使用和理解.

  • 它包含易于构建的概念高度模块化的网络层,优化器和嵌入其中的各种指标.

  • 它包括TensorFlow工作系统的完全透明性.

  • 它包含强大的辅助函数来训练内置的张量,这些张量接受多个输入,输出和优化器.

  • 它包括简单和美丽的图形可视化.

  • 图形可视化包括权重,渐变和激活的各种细节.

执行以下命令安装TFLearn :

  pip install tflearn

e执行上面的代码,将生成以下输出 :

安装TFLearn

下图显示了TFLearn与Random Forest分类器的实现 :

from __future__ import division, print_function, absolute_import#TFLearn module implementationimport tflearnfrom tflearn.estimators import RandomForestClassifier# Data loading and pre-processing with respect to datasetimport tflearn.datasets.mnist as mnistX, 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])