Xinglong Li
Xinglong Li

Reputation: 21

pytorch versus autograd.numpy

What are the big differences between pytorch and numpy, in particular, the autograd.numpy package? ( since both of them can compute the gradient automatically for you.) I know that pytorch can move tensors to GPU, but is this the only reason for choosing pytorch over numpy? While pytorch is well known for deep learning, obviously it can be used for almost any machine learning algorithm, its nn.Module structure is very flexible and we don't have to confine to the neural networks. (although I've never seen any neural network model written in numpy) So I'm wondering what's the biggest difference underlying pytorch and numpy.

Upvotes: 2

Views: 736

Answers (1)

Jan
Jan

Reputation: 1240

I'm not sure if this question can be objectively answered, but besides the GPU functionality, it offers

  • Parallelisation across GPUs
  • Parallelisation across Machines
  • DataLoaders / Manipulators incl. asynchronous pre-fetching
  • Optimizers
  • Predefined/Pretrained Models (can save you a lot of time)
  • ...

But as you said, it's build around deep/machine learning, so that is what it's good as while numpy (together with scipy) is much more general and can be used to solve a large range of other engineering problems (possibly using methods that are not en vogue at the moment).

Upvotes: 1

Related Questions