57 lines
3.6 KiB
Markdown
57 lines
3.6 KiB
Markdown
# 1.1 Pytorch 简介
|
||
|
||
## 1.1.1 PyTorch的由来
|
||
很多人都会拿PyTorch和Google的Tensorflow进行比较,这个肯定是没有问题的,因为他们是最火的两个深度学习框架了。但是说到PyTorch,其实应该先说[Torch](http://torch.ch)。
|
||
|
||
## 1.1.2 Torch是什么?
|
||
|
||
**Torch英译中:火炬**
|
||
|
||
A Tensor library like Numpy, unlike Numpy it has strong GPU support. Lua is a wrapper for Torch (Yes! you need to have a good understanding of Lua), and for that you will need LuaRocks package manager.
|
||
[1](https://stackoverflow.com/questions/44371560/what-is-the-relationship-between-pytorch-and-torch)
|
||
|
||
Torch是一个与Numpy类似的张量(Tensor)操作库,与Numpy不同的是Torch对GPU支持的很好,Lua是Torch的上层包装。
|
||
|
||
Torch is not going anywhere. PyTorch and Torch use the same C libraries that contain all the performance: TH, THC, THNN, THCUNN and they will continue to be shared.
|
||
We still and will have continued engineering on Torch itself, and we have no immediate plan to remove that.
|
||
[2](https://discuss.pytorch.org/t/roadmap-for-torch-and-pytorch/38)
|
||
|
||
PyTorch和Torch使用包含所有相同性能的C库:TH, THC, THNN, THCUNN,并且它们将继续共享这些库。
|
||
|
||
这样的回答就很明确了,其实PyTorch和Torch都使用的是相同的底层,只是使用了不同的上层包装语言。
|
||
|
||
注:LUA虽然快,但是太小众了,所以才会有PyTorch的出现。
|
||
|
||
## 1.1.3 重新介绍 PyTorch
|
||
PyTorch is an open source machine learning library for Python, based on Torch, used for applications such as natural language processing. It is primarily developed by Facebook's artificial-intelligence research group, and Uber's "Pyro" software for probabilistic programming is built on it.
|
||
[3](https://en.wikipedia.org/wiki/PyTorch)
|
||
|
||
PyTorch是一个基于Torch的Python开源机器学习库,用于自然语言处理等应用程序。 它主要由Facebook的人工智能研究小组开发。Uber的"Pyro"也是使用的这个库。
|
||
|
||
PyTorch is a Python package that provides two high-level features:
|
||
|
||
Tensor computation (like NumPy) with strong GPU acceleration
|
||
|
||
Deep neural networks built on a tape-based autograd system
|
||
You can reuse your favorite Python packages such as NumPy, SciPy and Cython to extend PyTorch when needed.
|
||
[4](https://github.com/pytorch/pytorch)
|
||
|
||
PyTorch是一个Python包,提供两个高级功能:
|
||
* 具有强大的GPU加速的张量计算(如NumPy)
|
||
* 包含自动求导系统的的深度神经网络
|
||
|
||
## 1.1.4 对比PyTorch和Tensorflow
|
||
没有好的框架,只有合适的框架, [这篇知乎文章](https://zhuanlan.zhihu.com/p/28636490)有个简单的对比,所以这里就不详细再说了。
|
||
并且技术是发展的,知乎上的对比也不是绝对的,比如Tensorflow在1.5版的时候就引入了Eager Execution机制实现了动态图,PyTorch的可视化,windows支持,沿维翻转张量等问题都已经不是问题了。
|
||
|
||
## 1.1.5 再次总结
|
||
|
||
- PyTorch算是相当简洁优雅且高效快速的框架
|
||
- 设计追求最少的封装,尽量避免重复造轮子
|
||
- 算是所有的框架中面向对象设计的最优雅的一个,设计最符合人们的思维,它让用户尽可能地专注于实现自己的想法
|
||
- 大佬支持,与google的Tensorflow类似,FAIR的支持足以确保PyTorch获得持续的开发更新
|
||
- 不错的的文档(相比FB的其他项目,PyTorch的文档简直算是完善了,参考Thrift),PyTorch作者亲自维护的论坛 供用户交流和求教问题
|
||
- 入门简单
|
||
|
||
所以如果以上信息有吸引你的内容,那么请一定要读完这本书:)
|