×
TensorFlow 教程TensorFlow 简介TensorFlow 安装人工智能简介TensorFlow 数学基础机器学习和深度学习TensorFlow 基础TensorFlow 卷积神经网络TensorFlow 递归神经网络TensorBoard 可视化TensorFlow 单词嵌入TensorFlow 单层感知TensorFlow 线性回归TFLearn 安装和使用TensorFlow CNN和RNN区别TensorFlow KerasTensorFlow 分布式计算TensorFlow 导出TensorFlow 多层感知器学习TensorFlow 感知器隐藏层TensorFlow 优化器TensorFlow XOR实现TensorFlow 梯度下降优化TensorFlow 成型图表TensorFlow 识别图像神经网络训练的建议

TensorFlow TFLearn安装和使用


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

考虑TFLearn的以下重要功能 -

  • TFLearn易于使用和理解。
  • TFLearn包括简单的概念,以构建高度模块化的网络层,优化器和嵌入其中的各种指标。
  • TFLearn包括TensorFlow工作系统的完全透明性。
  • TFLearn包括强大的辅助函数,用于训练内置张量,这些张量接受多个输入,输出和优化器。
  • TFLearn包括简单而美观的图形可视化。
  • TFLearn图形可视化包括权重,梯度和激活的各种细节。

执行以下命令安装TFLearn -

pip install tflearn

执行上述代码后,将生成以下输出 -

下面代码是使用TFLearn实现随机森林分类器 -

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])

分类导航

关注微信下载离线手册

bootwiki移动版 bootwiki
(群号:472910771)