0
雷鋒網 AI科技評論消息,日前,Google Developers blog正式撰文發(fā)布TensorFlow 1.4版本,此次的更新迎來三個重大變化:Keras位于TensorFlow core中,Dataset API支持更多功能,引入效用函數tf.estimator.train_and_evaluate等等。
雷鋒網 AI科技評論編輯整理如下:
TensorFlow 1.4目前已經公開,這次迎來重大更新。此次更新后,將支持很多新的、令人興奮的特征,希望大家都能滿意。
Keras
在TensorFlow 1.4版本中,Keras從tf.contrib.keras轉移到tf.keras核心包。Keras目前是一個廣受歡迎的機器學習框架,它的高級API接口能大大縮短從付諸想法到實踐的時間。Keras平滑地集成了其他core TensorFlow功能,包括Estimator API。
事實上,通過調用tf.keras.estimator.model_to_estimator函數,大家可以從任何Keras模型中構建Estimator。
此次更新后,Keras處于TensorFlow core中了,大家可以在自己的產品工作流中用到它。
想要了解更多關于Keras的相關知識,請閱讀如下鏈接:
(https://keras.io/#getting-started-30-seconds-to-keras)
(https://keras.io/getting-started/sequential-model-guide/)
(https://keras.io/getting-started/functional-api-guide/)
想要了解更多關于Estimator的相關知識,請閱讀如下鏈接:
(https://developers.googleblog.com/2017/09/introducing-tensorflow-datasets.html)
數據集
TensorFlow 1.4版本中,Dataset API從tf.contrib.data中轉移到tf.data核心包。新版Dataset API將支持Python生成器。強烈建議大家使用Dataset API來為TensorFlow模型創(chuàng)建input pipeline,原因有如下幾點:
比起老版的API,這次更新的Dataset API提供了更多功能(feed_dict函數、基于隊列的pipeline)
Dataset API執(zhí)行效果更好
Dataset API更干凈,更易于使用
未來的開發(fā)重點將放在Dataset API上,而不是著眼于之前的API。如果想使用數據集,請閱讀如下說明:
介紹TensorFlow Estimator和數據集的博文(鏈接如上)
(https://www.tensorflow.org/versions/r1.4/programmers_guide/datasets)
(http://t.cn/RlWCD1b)
分布式訓練&評估Estimator
TensorFlow 1.4還引入了效用函數tf.estimator.train_and_evaluate,這能簡化訓練、評估以及
輸出Estimator模型的過程。該函數在訓練和評估過程中能支持分布式執(zhí)行,同時也仍然支持本地執(zhí)行。
其他增強功能
除了前面所述的一系列功能,TensorFlow 1.4還引入了一些額外的增強功能,在Release Note有詳細描述,地址:https://github.com/tensorflow/tensorflow/blob/master/RELEASE.md
安裝TensorFlow 1.4
目前可以使用標準pip來安裝TensorFlow 1.4版本。
# Note: the following command will overwrite any existing TensorFlow
# installation.
$ pip install --ignore-installed --upgrade tensorflow
# Use pip for Python 2.7
# Use pip3 instead of pip for Python 3.x
另外,tensorflow.org中的文件也已更新到1.4版本。
最后,TensorFlow的強大功能依賴于社群中的貢獻者們,非常感謝大家?guī)椭覀円黄疬M行開發(fā)。還沒有加入我們社群的人,請不要猶豫,大家一起在GitHub開發(fā)源代碼或者在Stack Overflow上幫助回答問題吧。
希望你們都能喜歡這些新功能。
雷鋒網 AI科技評論編輯整理。
雷峰網版權文章,未經授權禁止轉載。詳情見轉載須知。