Google 開發者大會 (Google Developer Days,簡稱 GDD) 是展示 Google 最新開發者產品和平臺的全球盛會,旨在幫助你快速開發優質應用,發展和留住活躍使用者群,充分利用各種工具獲得更多收益。2018 Google 開發者大會於 9 月 20 日和 21 日於上海舉辦。?Google 開發者大會 2018 掘金專題
2018 年 9 月 21 日 丘天豪(Google Brain 軟體工程師)帶來一場《使用 TensorFlow Extended (TFX) 在生產環境中部署機器學習》的演講,本文將對演講做一個回顧。
TensorFlow Extended


TensorFlow Extended 平臺的組成結構如上圖所示,下面將根據 Google 開源的 四個部分進行介紹。
資料轉換 (TensorFlow Trainsform)

在使用資料集之前,往往需要對資料進行轉換,TFT 允許將資料轉換成 TF 計算圖,同時也可以定義一些特殊的轉換來表達特殊的特徵。生成的 TF 計算圖是完成密封的,包含所有的特徵值資訊,這也就意味著可以應用於訓練和部署中。這個是十分重要的一點,在生產環境中,有可能我們訓練和部署所使用的語言和路徑是不相同的,而 TF 計算圖是完成密封的,很好的解決了這個問題。
示例:
計程車給小費例項


GitHub:github.com/tensorflow/…
模型訓練 (Estimators or Keras)
使用 TensorFlow Estimators 進行模型訓練

訓練好的模型會以 SavedModel
形式輸出。

使用 tf.Keras 進行模型訓練

模型評估和驗證(TensorFlow Model Analysis)
在完成模型訓練之後,往往需要重新編寫程式碼對模型進行評估和驗證。TFMA 就是為了解決這個問題出現。

在執行上圖所示程式碼後,會出現如下圖這樣的圖形介面,更加直觀的對模型就行評估。

GitHub:github.com/tensorflow/…
模型部署 (TensorFlow Serving)

在使用 TensorFlow Serving 部署模型之後,使用 Serving 介面即可進行訪問。

GitHub:github.com/tensorflow/…
資料分析和驗證 (TensorFlow Data Validation)

Data Validation 模組組成如下:

計算統計資料與統計資料視覺化

推導初始 Schema

資料驗證



訓練/線上資料偏差檢測

GitHub:github.com/tensorflow/…
總結
實際生產環境中使用 TFX 流程如下:

論文:TFX: A TensorFlow-Based Production-Scale Machine Learning Platform,KDD(2017)
以上就是本次演講的全部內容,希望對大家有所幫助。
閱讀更多 Google 開發者大會 2018 技術乾貨