Google TensorFlow 机器学习框架介绍和使用

TensorFlow是什么?

TensorFlow是Google开源的第二代用于数字计算(numerical computation)的软件库。它是基于数据流图的处理框架,图中的节点表示数学运算(mathematical operations),边表示运算节点之间的数据交互。TensorFlow从字面意义上来讲有两层含义,一个是Tensor,它代表的是节点之间传递的数据,通常这个数据是一个多维度矩阵(multidimensional data arrays)或者一维向量;第二层意思Flow,指的是数据流,形象理解就是数据按照流的形式进入数据运算图的各个节点。

 

TensorFlow是一个非常灵活的框架,它能够运行在个人电脑或者服务器的单个或多个CPU和GPU上,甚至是移动设备上。TensorFlow最早是Google大脑团队为了研究机器学习和深度神经网络而开发的,但后来发现这个系统足够通用,能够支持更加广泛的应用。至于为什么谷歌要开源这个框架,它是这样回应的:

“IfTensorFlow is so great, why open source it rather than keep it proprietary? Theanswer is simpler than you might think: We believe that machine learning is akey ingredient to the innovative products and technologies of the future.Research in this area is global and growing fast, but lacks standard tools. Bysharing what we believe to be one of the best machine learning toolboxes in theworld, we hope to create an open standard for exchanging research ideas andputting machine learning in products. Google engineers really do use TensorFlowin user-facing products and services, and our research group intends to shareTensorFlow implementations along side many of our research publications.”

TensorFlow特点

1.    灵活(Deep Flexibility)

它不仅是可以用来做神经网络算法研究,也可以用来做普通的机器学习算法,甚至是只要你能够把计算表示成数据流图,都可以用TensorFlow。

2.    便携(True Portability)

这个工具可以部署在个人PC上,单CPU,多CPU,单GPU,多GPU,单机多GPU,多机多CPU,多机多GPU,Android手机上等,几乎涵盖各种场景的计算设备。

3.    研究和产品的桥梁(Connect Research andProduction)

在谷歌,研究科学家可以用TensorFlow研究新的算法,产品团队可以用它来训练实际的产品模型,更重要的是这样就更容易将研究成果转化到实际的产品。另外Google在白皮书上说道,几乎所有的产品都用到了TensorFlow,比如搜索排序,语音识别,谷歌相册,自然语言处理等。

4.    自动做微分运算(Auto-Differentiation)

机器学习中的很多算法都用到了梯度,使用TensorFlow,它将自动帮你求出梯度,只要你定义好目标函数,增加数据就好了。听上去很诱人,暂时不知道具体咋实现的。

5.    语言灵活(Language Options)

TensorFlow使用C++实现的,然后用Python封装,暂时只支持这两种语言,谷歌号召社区通过SWIG开发更多的语言接口来支持TensorFlow。

6.    最大化性能(Maximize Performance)

通过对线程,队列和异步计算的支持(first-class support),TensorFlow可以运行在各种硬件上,同时根据计算的需要,合理将运算分配到相应的设备,比如卷积就分配到GPU上。

猜你喜欢

转载自www.cnblogs.com/jiftle/p/9185582.html