![前端框架和库的区别](https://i-blog.csdnimg.cn/blog_migrate/2ed7d630ba996798baeb6c38ba31523d.png)
前端框架和库的区别
库和框架 (Libraries and Frameworks)
In this chapter, we will relate deep learning to the different libraries and frameworks.
在本章中,我们将深度学习与不同的库和框架相关联。
深度学习和Theano (Deep learning and Theano)
If we want to start coding a deep neural network, it is better we have an idea how different frameworks like Theano, TensorFlow, Keras, PyTorch etc work.
如果我们想开始对深度神经网络进行编码,最好了解一下Theano,TensorFlow,Keras,PyTorch等不同框架如何工作。
Theano is python library which provides a set of functions for building deep nets that train quickly on our machine.
Theano是python库,它提供了一组功能来构建可在我们的机器上快速训练的深层网络。
Theano was developed at the University of Montreal, Canada under the leadership of Yoshua Bengio a deep net pioneer.
Theano是在加拿大深奥网络先驱Yoshua Bengio的领导下在加拿大蒙特利尔大学开发的。
Theano lets us define and evaluate mathematical expressions with vectors and matrices which are rectangular arrays of numbers.
Theano让我们用向量和矩阵定义和评估数学表达式,向量和矩阵是数字的矩形阵列。
Technically speaking, both neural nets and input data can be represented as matrices and all standard net operations can be redefined as matrix operations. This is important since computers can carry out matrix operations very quickly.
从技术上讲,神经网络和输入数据都可以表示为矩阵,而所有标准网络运算都可以重新定义为矩阵运算。 这很重要,因为计算机可以非常快速地执行矩阵运算。
We can process multiple matrix values in parallel and if we build a neural net with this underlying structure, we can use a single machine with a GPU to train enormous nets in a reasonable time window.
我们可以并行处理多个矩阵值,如果我们使用此基础结构构建神经网络,则可以使用带有GPU的单台机器在合理的时间范围内训练庞大的网络。
However if we use Theano, we have to build the deep net from ground up. The library does not provide complete functionality for creating a specific type of deep net.
但是,如果使用Theano,则必须从头开始构建深层网络。 该库不提供用于创建特定类型的深网的完整功能。
Instead, we have to code every aspect of the deep net like the model, the layers, the activation, the training method and any special methods to stop overfitting.
相反,我们必须对深层网络的各个方面进行编码,例如模型,层,激活,训练方法以及任何特殊方法,以防止过度拟合。
The good news however is that Theano allows the building our implementation over a top of vectorized functions providing us with a highly optimized solution.
好消息是,Theano允许在矢量化函数之上构建我们的实现,从而为我们提供了高度优化的解决方案。
There are many other libraries that extend the functionality of Theano. TensorFlow and Keras can be used with Theano as backend.
还有许多其他库可以扩展Theano的功能。 TensorFlow和Keras可以与Theano一起用作后端。
使用TensorFlow进行深度学习 (Deep Learning with TensorFlow)
Googles TensorFlow is a python library. This library is a great choice for building commercial grade deep learning applications.
Google的TensorFlow是一个python库。 该库是构建商业级深度学习应用程序的绝佳选择。
TensorFlow grew out of another library DistBelief V2 that was a part of Google Brain Project. This library aims to extend the portability of machine learning so that research models could be applied to commercial-grade applications.
TensorFlow源自另一个库DistBelief V2,该库是Google Brain Project的一部分。 该库旨在扩展机器学习的可移植性,以便将研究模型应用于商业级应用程序。
Much like the Theano library, TensorFlow is based on computational graphs where a node represents persistent data or math operation and edges represent the flow of data between nodes, which is a multidimensional array or tensor; hence the name TensorFlow
与Theano库非常相似,TensorFlow基于计算图,其中一个节点表示持久数据或数学运算,边缘表示节点之间的数据流,多维数组或张量。 因此名称为TensorFlow
The output from an operation or a set of operations is fed as input into the next.
一个操作或一组操作的输出将作为输入馈入下一个。
Even though TensorFlow was designed for neural networks, it works well for other nets where computation can be modelled as data flow graph.
即使TensorFlow是为神经网络设计的,但它也适用于其他可以将计算建模为数据流图的网络。
TensorFlow also uses several features from Theano such as common and sub-expression elimination, auto differentiation, shared and symbolic variables.
TensorFlow还使用了Theano的多项功能,例如消除公共和子表达式,自动区分,共享和符号变量。
Different types of deep nets can be built using TensorFlow like convolutional nets, Autoencoders, RNTN, RNN, RBM, DBM/MLP and so on.
使用TensorFlow可以构建不同类型的深层网络,例如卷积网络,自动编码器,RNTN,RNN,RBM,DBM / MLP等。
However, there is no support for hyper parameter configuration in TensorFlow.For this functionality, we can use Keras.
但是,在TensorFlow中不支持超参数配置。为此功能,我们可以使用Keras。
深度学习和Keras (Deep Learning and Keras)
Keras is a powerful easy-to-use Python library for developing and evaluating deep learning models.
Keras是一个功能强大的易于使用的Python库,用于开发和评估深度学习模型。
It has a minimalist design that allows us to build a net layer by layer; train it, and run it.
它具有极简设计,可让我们逐层构建网络。 训练它并运行它。
It wraps the efficient numerical computation libraries Theano and TensorFlow and allows us to define and train neural network models in a few short lines of code.
它包装了高效的数值计算库Theano和TensorFlow,并允许我们用几行短代码定义和训练神经网络模型。
It is a high-level neural network API, helping to make wide use of deep learning and artificial intelligence. It runs on top of a number of lower-level libraries including TensorFlow, Theano,and so on. Keras code is portable; we can implement a neural network in Keras using Theano or TensorFlow as a back ended without any changes in code.
它是高级神经网络API,有助于广泛使用深度学习和人工智能。 它在TensorFlow,Theano等许多较低级别的库之上运行。 Keras代码是可移植的; 我们可以使用Theano或TensorFlow作为后端在Keras中实现神经网络,而无需更改任何代码。
前端框架和库的区别