- TensorFlow 教程
- TensorFlow - 主頁
- TensorFlow - 介紹
- TensorFlow - 安裝
- 認識人工智慧
- 數學基礎
- 機器學習和深度學習
- TensorFlow - 基礎知識
- 卷積神經網路
- 迴圈神經網路
- TensorBoard 視覺化
- TensorFlow - Word Embedding
- 單層感知器
- TensorFlow - 線性迴歸
- TFLearn 及其安裝
- CNN 和 RNN 差異
- TensorFlow - Keras
- TensorFlow - 分散式計算
- TensorFlow - 匯出
- 多層感知器學習
- 感知器的隱藏層
- TensorFlow - 最佳化器
- TensorFlow - XOR 實現
- 梯度下降最佳化
- TensorFlow - 繪製圖
- 使用 TensorFlow 進行影像識別
- 神經網路訓練建議
- TensorFlow 實用資源
- TensorFlow - 快速指南
- TensorFlow - 實用資源
- TensorFlow - 討論
TensorFlow - TFLearn 及其安裝
TFLearn 可以定義為模組化且透明的深度學習方面,用於 TensorFlow 框架。TFLearn 的主要動機是為 TensorFlow 提供一個較高級別的 API,以便促進和展示新的實驗。
考慮 TFLearn 的以下重要特徵 −
TFLearn 易於使用和理解。
它包含易於構建高度模組化網路層、最佳化器及其內嵌的各種度量的概念。
它包含與 TensorFlow 工作系統完全的透明性。
它包含強大的幫助函式,用於訓練內建的接受多輸入、輸出和最佳化器的張量。
它包含簡單美觀的圖形視覺化。
圖形視覺化包括權重、梯度和啟用的各種詳細資訊。
透過執行以下命令安裝 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])
廣告