Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 802
Xinglong Li Avatar asked Feb 04 '26 04:02

Xinglong Li


1 Answers

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).

like image 130
Jan Avatar answered Feb 13 '26 03:02

Jan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!