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