Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the relationship between PyTorch and Torch?

Tags:

pytorch

torch

There are two PyTorch repositories :

  • https://github.com/hughperkins/pytorch
  • https://github.com/pytorch/pytorch

The first clearly requires Torch and lua and is a wrapper, but the second doesn't make any reference to the Torch project except with its name.

How is it related to the Lua Torch?

like image 224
Labo Avatar asked Jun 05 '17 14:06

Labo


People also ask

Is Torch part of PyTorch?

PyTorch is an open source machine learning framework based on the Torch library, used for applications such as computer vision and natural language processing, primarily developed by Meta AI.

Why is it called PyTorch?

Torch, SMORCH ??? PyTorch developed from Torch7. A precursor to the original Torch was a library called SVM-Torch, which was developed around 2001. The SVM stands for Support Vector Machines.

What is Torch based on?

Torch is an open-source machine learning library, a scientific computing framework, and a script language based on the Lua programming language.

Is PyTorch owned by Facebook?

PyTorch was born at Facebook in 2018 as a unified machine learning framework. It was created as a successor to Caffe2, one of the popular ML frameworks for building deep learning models.


1 Answers

Here a short comparison on pytorch and 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.

PyTorch:

No need for the LuaRocks package manager, no need to write code in Lua. And because we are using Python, we can develop Deep Learning models with utmost flexibility. We can also exploit major Python packages likes scipy, numpy, matplotlib and Cython with PyTorch's own autograd.

There is a detailed discussion on this on pytorch forum. Adding to that both PyTorch and Torch use THNN. Torch provides lua wrappers to the THNN library while Pytorch provides Python wrappers for the same.

PyTorch's recurrent nets, weight sharing and memory usage with the flexibility of interfacing with C, and the current speed of Torch.

For more insights, have a look at this discussion session here.

like image 179
blitu12345 Avatar answered Sep 23 '22 07:09

blitu12345