{"id":119478,"date":"2018-09-16T08:13:51","date_gmt":"2018-09-16T00:13:51","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=119478"},"modified":"2018-09-05T09:14:38","modified_gmt":"2018-09-05T01:14:38","slug":"tensorflow-ai-neural","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/tensorflow-ai-neural.html","title":{"rendered":"TensorFlow2.0\u7248\u5373\u5c06\u6765\u88ad\uff01"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nTensorFlow\u662f\u5feb\u901f\u5f00\u53d1\u795e\u7ecf\u7f51\u7edc\u7684\u4e00\u822c\u6846\u67b6\uff0c\u662f\u8c37\u6b4c\u5bf9\u4e8e\u673a\u5668\u5b66\u4e60\u548c\u6570\u636e\u79d1\u5b66\u9886\u57df\u7684\u4e00\u5927\u91cd\u8981\u8d21\u732e\u3002TensorFlow\u521a\u88ab\u63a8\u51fa\uff0c\u5c31\u56e0\u4e3a\u5176\u5f3a\u5927\u7684\u6613\u7528\u6027\uff0c\u5728\u9886\u57df\u5185\u88ab\u5e7f\u6cdb\u91c7\u7528\u5e76\u8fc5\u901f\u6210\u4e3a\u6df1\u5ea6\u5b66\u4e60\u7684\u901a\u7528\u5e73\u53f0\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

\u524d\u4e9b\u65e5\u5b50\u8c37\u6b4c\u521a\u521a\u53d1\u5e03\u5b8cTensorFlow1.9\uff0c\u5e76\u5e26\u6765\u4e86\u4e00\u5927\u6279\u7684\u6027\u80fd\u66f4\u65b0\u3002\u8fd1\u65e5\u6d88\u606f\uff0cTensorFlow2.0\u9884\u8ba1\u5c06\u5728\u4eca\u5e74\u5e74\u672b\u63a8\u51fa\u9996\u4e2a\u6d4b\u8bd5\u7248\u3002TensorFlow1.9\u7684\u70ed\u98ce\u521a\u8fc7\uff0c\u5927\u5bb6\u53c8\u5c06\u671f\u5f85\u7684\u76ee\u5149\u9501\u5b9a\u5728TensorFlow2.0\u3002\u8fd9\u91cc\u662f\u4e00\u4e9bTensorFlow2.0\u7684\u9884\u8ba1\u6027\u80fd\u66f4\u65b0\u3002<\/p>\n

\u65b0\u7248\u672c\uff1aTensorFlow2.0\u7684\u9884\u8ba1\u6027\u80fd\u6539\u8fdb<\/strong><\/div>\n

TensorFlow2.0\u9664\u4e86\u89e3\u51b3\u4e00\u90e8\u5206\u6027\u80fd\u95ee\u9898\uff0c\u5176\u6784\u5efa\u8005\u8fd8\u5c06\u8fdb\u4e00\u6b65\u7ea0\u6b63\u517c\u5bb9\u6027\u548c\u8fde\u7eed\u6027\u7684\u95ee\u9898\uff0c\u5c06\u7528\u6237\u5bf9\u7f16\u7a0b\u6a21\u578b\u7684\u671f\u671b\u4e0eTensorFlow\u66f4\u597d\u5730\u7ed3\u5408\u8d77\u6765\u3002TensorFlow2.0\u7684\u6838\u5fc3\u529f\u80fd\u9884\u8ba1\u4e3a\u201cEager Execution\u201d\u73af\u5883\u3002Eager Execution\u4e8e2017\u5e74\u7531Google Brain\u63a8\u51fa\uff0c \u662f\u4e00\u79cd\u547d\u4ee4\u5f0f\u7684\u7f16\u7a0b\u73af\u5883\uff0c\u53ef\u4ee5\u5728\u4e0d\u6784\u5efa\u56fe\u8868\u7684\u60c5\u51b5\u4e0b\u8fc5\u901f\u8bc4\u4f30\u64cd\u4f5c\uff0c\u76ee\u7684\u5728\u4e8e\u4f7f\u67b6\u6784\u66f4\u6613\u4e8e\u5b66\u4e60\u548c\u4f7f\u7528\u3002<\/p>\n

TensorFlow2.0\u9884\u8ba1\u6027\u80fd\u66f4\u65b0\uff1a<\/p>\n

\u6269\u5c55\u5bf9\u66f4\u591a\u5e73\u53f0\u548c\u8bed\u8a00\u7684\u652f\u6301\u3002<\/p>\n

\u901a\u8fc7\u4ea4\u6362\u683c\u5f0f\u7684\u6807\u51c6\u5316\u548c API \u7684\u4e00\u81f4\u6027\uff0c\u6539\u8fdb\u5e73\u53f0\u548c\u8bed\u8a00\u7ec4\u4ef6\u4e4b\u95f4\u7684\u517c\u5bb9\u6027\u3002<\/p>\n

\u5220\u9664\u5df2\u5f03\u7528\u7684 API\uff0c\u4ee5\u51cf\u5c11\u7528\u6237\u4e4b\u95f4\u7684\u6df7\u6dc6\u3002<\/p>\n

TensorFlow2.0\u4e5f\u88ab\u8ba1\u5212\u5bf9\u5347\u7ea7\u8fdb\u884c\u4e00\u7cfb\u5217\u7684\u8bbe\u8ba1\u5ba1\u67e5\u3002\u4e3a\u4e86\u7b80\u5316\u8fc7\u5ea6\uff08transition\uff09\uff0c\u5f00\u53d1\u4eba\u5458\u5c06\u521b\u5efa\u4e00\u4e2a\u8f6c\u6362\u5de5\u5177\uff0c\u8be5\u5de5\u5177\u5c06\u66f4\u65b0Python\u4ee3\u7801\u4ee5\u4f7f\u7528\u4e0eTensorFlow 2.0\u517c\u5bb9\u7684API\uff0c\u6216\u8005\u5728\u65e0\u6cd5\u81ea\u52a8\u8fdb\u884c\u8f6c\u6362\u7684\u60c5\u51b5\u4e0b\u53d1\u51fa\u8b66\u544a\u3002\u53e6\u5916\uff0cTensorFlow 2.0\u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7ea0\u6b63\u9519\u8bef\u5e76\u8fdb\u884c\u6539\u8fdb\u7684\u673a\u4f1a\uff0c\u800c\u8fd9\u4e9b\u6539\u8fdb\u5728\u8bed\u4e49\u7248\u672c\u63a7\u5236\u4e0b\u662f\u7981\u6b62\u7684\u3002<\/p>\n

\u65b0\u6d88\u606f\u79f0\uff0cTensorFlow2.0\u76841.X\u7cfb\u5217\u5e76\u4e0d\u4f1a\u5f00\u53d1\u65b0\u529f\u80fd\uff0c\u4f462.0\u53d1\u5e03\u540e\u7684\u4e00\u5e74\u5185\uff0c1.X\u7cfb\u7edf\u5c06\u4f1a\u6709\u5b89\u5168\u8865\u4e01\u3002<\/p>\n

\u4ecb\u7ecd\u5b8c\u4e86\u9884\u5c06\u53d1\u5e03\u7684\u65b0\u7248\u672c\uff0c\u73b0\u5728\u8ba9\u6211\u4eec\u7b80\u5355\u634b\u987a\u4e00\u4e0bTensorFlow\u673a\u5668\u5b66\u4e60\u67b6\u6784\u7684\u66f4\u65b0\u4e4b\u8def\u3002<\/p>\n

TensorFlow1.9\u7684\u4e3b\u8981\u6027\u80fd\u66f4\u65b0<\/strong><\/div>\n

\u66f4\u65b0\u6587\u6863tf.keras\uff1a\u57fa\u4e8e\u65b0Keras\u7684\u5165\u95e8\u548c\u7a0b\u5e8f\u5458\u6307\u5357\u9875\u9762\u3002<\/p>\n

\u4e3aKeras 2.1.6 API\u66f4\u65b0tf.keras\u3002<\/p>\n

\u6dfb\u52a0tf.keras.layers.CuDNNGRU\u548ctf.keras.layers.CuDNNLSTM\u5c42\u3002<\/p>\n

\u5c06\u6838\u5fc3\u529f\u80fd\u5217\u7684\u652f\u6301\u548c\u635f\u5931\u6dfb\u52a0\u5230\u68af\u5ea6boosted tree\u4f30\u8ba1\u5668\u4e2d\u3002<\/p>\n

Python\u63a5\u53e3\u7528\u4e8eTFLite\u4f18\u5316\u8f6c\u6362\u5668\u5df2\u6269\u5c55\uff0c\u547d\u4ee4\u884c\u754c\u9762\uff08toco\uff0ctflite_convert\uff09\u518d\u6b21\u5305\u62ec\u5728\u6807\u51c6pip\u5b89\u88c5\u4e2d\u3002<\/p>\n

\u7a7a\u53d8\u91cf\u8303\u56f4\uff0c\u7528variable_scope(tf.get_variable_scope(), \u2026)\u66ff\u6362variable_scope(\u201d, \u2026)\u3002<\/p>\n

\u7528\u4e8e\u6784\u5efa\u81ea\u5b9a\u4e49\u64cd\u4f5c\u7684\u6807\u5934\u4ecesite-packages \/ external\u79fb\u81f3site-packages \/ tensorflow \/ include \/ external\u3002<\/p>\n

TensorFlow1.8\u7684\u4e3b\u8981\u6027\u80fd\u66f4\u65b0<\/strong><\/div>\n

\u80fd\u591f\u5c06\u6570\u636e\u9884\u53d6\u5230GPU\u5185\u5b58\u3002\u53ef\u4ee5\u52a0\u5feb\u9884\u5148\u77e5\u9053\u6570\u636eGPU\u64cd\u4f5c\u7684\u901f\u5ea6\uff0c\u6570\u636e\u53ef\u4ee5\u540c\u65f6\u88ab\u590d\u5236\u5230GPU\u4e2d\u3002<\/p>\n

\u652f\u6301Cloud TPU\u7684\u7b2c\u4e09\u4ee3\u6d41\u6c34\u7ebf\u8bbe\u7f6e\uff0c\u63d0\u9ad8\u4e86\u6027\u80fd\u548c\u53ef\u7528\u6027\u3002TPU\u662fGoogle Cloud\u4e13\u7528\u7684\u786c\u4ef6\u5355\u5143\uff0c\u53ef\u4ee5\u52a0\u901fTensorFlow\u6027\u80fd\u3002<\/p>\n

\u6dfb\u52a0\u4e86 tf.contrib\u3002{proto\uff0crpc}\u4ee5\u5141\u8bb8\u901a\u7528\u7684\u539f\u578b\u89e3\u6790\u548c RPC \u901a\u4fe1\u3002<\/p>\n

TensorFlow1.7\u7684\u4e3b\u8981\u6027\u80fd\u66f4\u65b0<\/strong><\/div>\n

\u4ece contrib \u4e2d\u79fb\u9664 Eager \u6a21\u5f0f\uff0c\u4f7f\u7528 tf.enable_eager_execution()\u3002<\/p>\n

Graph \u91cd\u5199\u4e86\u4eff\u771f\u5b9a\u70b9\u91cf\u5316\u5668\uff0c\u4e0eTensorFlow Lite \u517c\u5bb9\uff0c\u7531\u65b0\u7684tf.contrib.quantize \u5305\u63d0\u4f9b\u652f\u6301\u3002<\/p>\n

\u4f7f\u7528 tf.custom_gradient \u8f7b\u677e\u5b9a\u5236\u68af\u5ea6\u8ba1\u7b97\u3002<\/p>\n

TensorBoard \u8c03\u8bd5\u5668\u63d2\u4ef6\uff0c\u5373 TensorFlow \u8c03\u8bd5\u5668\uff08 tfdbg \uff09\u7684\u56fe\u5f62\u7528\u6237\u754c\u9762\uff08GraphicalUser Interface, GUI\uff09\uff0c\u63a8\u51faalpha \u7248\u672c\u3002<\/p>\n

\u5229\u7528\u65b0\u7684 tf.contrib.data.SqlDataset\uff0c\u652f\u6301\u5c06 sqlite \u6570\u636e\u5e93\u4f5c\u4e3a Dataset\u8fdb\u884c\u8bfb\u53d6\u3002<\/p>\n

Distributed Mutex \/ CriticalSection \u88ab\u6dfb\u52a0\u81f3 tf.contrib.framework.CriticalSection\u3002<\/p>\n

tf.regex_replace \u80fd\u66f4\u597d\u652f\u6301\u6587\u672c\u5904\u7406\u3002<\/p>\n

tf.contrib.data.bucket_by_sequence_length \u652f\u6301\u7b80\u5355\u9ad8\u6548\u7684\u5e8f\u5217\u8f93\u5165\u3002<\/p>\n

TensorFlow1.6\u7684\u4e3b\u8981\u6027\u80fd\u66f4\u65b0<\/strong><\/div>\n

\u9488\u5bf9 CUDA 9.0 \u548c cuDNN 7 \u9884\u6784\u5efa\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002<\/p>\n

\u7f16\u8bd1\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u4f7f\u7528 AVX \u6307\u4ee4\uff0c\u4f46\u4f1a\u7834\u574f\u65e7\u7248CPU\u4e0a\u7684TF\u3002<\/p>\n

\u9488\u5bf9\u975e\u63d2\u69fd\u53d8\u91cf\u7684\u65b0\u4f18\u5316\u5668\u5185\u90e8API\u3002<\/p>\n

tf.estimator.{FinalExporter,LatestExporter} \u53ef\u5bfc\u51fa\u88ab\u5265\u79bb\u7684 SavedModels \uff0c\u8fd9\u589e\u52a0\u4e86 SavedModels \u7684\u524d\u5411\u517c\u5bb9\u6027\uff1bFFT \u652f\u6301\u6dfb\u52a0\u5230 XLA CPU\/GPU \u3002<\/p>\n

Android TF\u53ef\u4ee5\u5728\u517c\u5bb9\u7684 Tegra \u8bbe\u5907\u4e0a\u4f7f\u7528 CUDA \u52a0\u901f\u6765\u6784\u5efa\u3002<\/p>\n

\u589e\u52a0\u4e86 Getting Started \u7684\u7b2c\u4e8c\u4e2a\u7248\u672c\uff0c\u4e3b\u8981\u9488\u5bf9\u673a\u5668\u5b66\u4e60\u65b0\u624b\u3002<\/p>\n

\u9610\u660e\u4e86 resize_images.align_corners \u53c2\u6570\u6587\u6863\u3002<\/p>\n

\u589e\u52a0\u4e86 TPU \u6587\u6863\u3002<\/p>\n

\u589e\u52a0\u4e86\u5ba2\u6237\u7aef\u8282\u6d41\u3002<\/p>\n

\u5728 FileSystem \u63a5\u53e3\u4e0a\u589e\u52a0\u4e86 FlushCaches() \u65b9\u6cd5\uff0c\u7528\u4e8e GscFileSystem \u5b9e\u73b0\u3002<\/p>\n

TensorFlow1.5\u7684\u4e3b\u8981\u6027\u80fd\u66f4\u65b0<\/strong><\/div>\n

Eager Execution\uff1a\u9884\u89c8\u7248\u5df2\u63d0\u4f9b\u4e0b\u8f7d\u3002<\/p>\n

TensorFlow Lite\uff1adev \u9884\u89c8\u7248\u5df2\u63d0\u4f9b\u4e0b\u8f7d\u3002<\/p>\n

\u652f\u6301 CUDA 9 \u548c cuDNN 7\u3002<\/p>\n

\u52a0\u901f\u7ebf\u6027\u4ee3\u6570\uff08XLA\uff09\uff1a<\/p>\n

\u5c06 complex64 \u652f\u6301\u6dfb\u52a0\u5230 XLA \u7f16\u8bd1\u5668\u3002<\/p>\n

\u5c06 bfloat \u652f\u6301\u6dfb\u52a0\u5230 XLA \u57fa\u7840\u8bbe\u65bd\u3002<\/p>\n

\u4f7f ClusterSpec \u4f20\u64ad\u4e0e XLA \u8bbe\u5907\u4e00\u8d77\u5de5\u4f5c\u3002<\/p>\n

\u4f7f\u7528\u51b3\u5b9a\u6027\u6267\u884c\u7a0b\u5e8f\u6765\u751f\u6210XLA\u56fe\u3002<\/p>\n

tf.contrib\u6a21\u5757\u589e\u52a0\u4e86\u5f88\u591a\u9644\u52a0\u529f\u80fd\uff0c\u4f8b\u5982\uff1atf.contrib.bayesflow.layers\u6982\u7387\u795e\u7ecf\u7f51\u7edc\uff08PNN\uff09\u7684\u5b9e\u73b0\u3002<\/p>\n

TensorFlow1.4\u7684\u4e3b\u8981\u6027\u80fd\u66f4\u65b0<\/strong><\/div>\n

tf.keras \u6210\u4e3a\u6838\u5fc3 TensorFlow API \u7684\u4e00\u90e8\u5206\u3002\u63d0\u4f9bTensorFlow Keras API\u7684\u76ee\u7684\u4e3b\u8981\u662f\u4e3a\u4e86\u5411\u540e\u517c\u5bb9\uff0c\u53ef\u4ee5\u66f4\u5bb9\u6613\u7684\u5c06Keras\u79fb\u690d\u5230TensorFlow\u3002<\/p>\n

tf.data \u6210\u4e3a\u6838\u5fc3 TensorFlow API \u7684\u4e00\u90e8\u5206\u3002<\/p>\n

train_and_evaluate\u529f\u80fd\u63d0\u4f9b\u4e86\u4e00\u79cd\u5728\u96c6\u7fa4\u4e2d\u4ee5\u5206\u5e03\u5f0f\u65b9\u5f0f\u8fd0\u884cTensorFlow Estimator \uff08\u7528\u4e8e\u81ea\u52a8\u914d\u7f6e\u516c\u5171\u6a21\u578b\u53c2\u6570\uff09\u7684\u7b80\u5355\u65b9\u6cd5\u3002<\/p>\n

\u6dfb\u52a0 tf.spectral.dct \u7528\u4e8e\u8ba1\u7b97 DCT-II\u3002<\/p>\n

TensorFlow\u7684\u5185\u7f6e\u8c03\u8bd5\u7cfb\u7edf\u5141\u8bb8\u5728\u8c03\u8bd5\u5668\u7684\u547d\u4ee4\u884c\u4e2d\u6267\u884c\u4efb\u610fPython\u4ee3\u7801\uff0c\u4ee5\u8fdb\u884c\u5feb\u901f\u68c0\u67e5\u548c\u4fee\u6539\u3002<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/blog.itpub.net\/31542119\/viewspace-2212702\/<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttps:\/\/lrxjmw.cn\/tensorflow-ai-neural.html<\/a>\u7f16\u8f91\uff1a\u5b54\u80dc\u8d85\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb TensorFlow\u662f\u5feb\u901f\u5f00\u53d1\u795e\u7ecf\u7f51\u7edc\u7684\u4e00\u822c\u6846\u67b6\uff0c\u662f\u8c37\u6b4c\u5bf9\u4e8e\u673a\u5668\u5b66\u4e60\u548c\u6570\u636e\u79d1\u5b66\u9886\u57df\u7684\u4e00\u5927\u91cd\u8981\u8d21\u732e\u3002Ten […]<\/p>\n","protected":false},"author":63,"featured_media":119481,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[21],"tags":[],"class_list":["post-119478","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/119478","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=119478"}],"version-history":[{"count":3,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/119478\/revisions"}],"predecessor-version":[{"id":119641,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/119478\/revisions\/119641"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/119481"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=119478"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=119478"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=119478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}