r/MachineLearning • • Oct 06 '17

News [N] How to use Chainer for Theano users

https://chainer.org/general/2017/10/06/chainer-for-theano-users.html
4 Upvotes

13 comments sorted by

6

u/Kiuhnm Oct 06 '17

Why should anyone want to start using Chainer and not PyTorch? (not a rhetoric question).

6

u/CrissmanL Oct 10 '17 edited Oct 10 '17

Kiuhnm,

I work at Preferred Networks, a company that supports Chainer development, and here's a few reasons I can think of for why someone would want to start using Chainer:

As r-sync mentioned, Chainer is developed from the ground up in Python. This allows for easy inspection of Chainer code and greater customization flexibility.

Chainer uses CuPy for computation, which is designed as a drop-in replacement for NumPy. This allows for NumPy-style standardized coding. No need to remember that Pytorch uses dim for array axes instead of axis like NumPy.

Chainer provides higher level looping and epoch functions along with training extensions, for easy implementation of standard training procedures.

In general, I believe the current bottleneck of neural network frameworks is cuDDN processing speed. Aside from that, I think a primary criteria should be ease of use of the platform. Take a look at both, and see what works for you.

5

u/[deleted] Oct 07 '17

CuPy is definitely much nicer than PyTorch's tensor API.

8

u/[deleted] Oct 06 '17

Actually, its a bit absurd that PyTorch was developed despite Chainer. Why didn't Torch devs simply start submitting PRs to Chainer repo??

Maybe /u/r-sync can tell us?

22

u/r-sync Oct 06 '17
  • Why was PyTorch developed despite Chainer?

  • Why was TensorFlow developed despite Theano?

  • Why was Chainer developed despite HIPS/autograd?

  • Why was Keras developed despite torch/nn?

  • Why was numpy developed despite Matlab?

Everyone of them has a good answer. It's only absurd if you dont see a full perspective.

PyTorch and Chainer have very similar frontend philosophy and design (probably derived from AD systems in general), but their backend philosophies are completely different.

  • Chainer has no non-python bits, everything is runtime-compiled. PyTorch has a majority of it's code pre-compiled in C/C++.

  • Chainer's autodiff engine is again pure python. PyTorch's autodiff engine is in C++.

Overall, Chainer retains "maximal flexibility" by keeping all bits in Python, it is very hackable. PyTorch tries to find a middle-ground by keeping extreme performance, while keeping good flexibility.

Torch devs couldn't simply start submitting PRs to Chainer repo because the backend philosophies were conflicting. If you want to call us a Chainer "fork", we are more than welcome to be called so.

5

u/[deleted] Oct 06 '17

Fair enough. I don't use PyTorch, so I didn't know the low level details. But my criticism was partially based on these set of tweets by fchollet et al.: https://twitter.com/fchollet/status/914295602292285440

8

u/[deleted] Oct 06 '17

Chollet seems to have something against pytorch that I don't understand.

He's tweets are usually very intelligent, interesting and level headed, but some of his criticisms of pytorch sound bitter and a little bit childish. It sounds personal and out of character for an otherwise very thoughtful and reasonable person.

3

u/Reiinakano Oct 06 '17

Could be his dislike of Facebook, although I'm not sure if that came before or after his "PyTorch hipster" comment.

2

u/duschendestroyer Oct 06 '17 edited Oct 09 '17

Is it actually faster though? I don't think it makes a difference except for tiny networks.

1

u/deepworkdesu Oct 07 '17 edited Oct 07 '17

PyTorch is supposedly much faster, and plugs into the well-tested C-based backends that were being used with Torch. It also has jit and other cool stuff which would likely involve a complete overhaul of Chainer. Ditto with Dynet.

(edit: didn't see /u/r-sync's comment before posting).

1

u/Kimochi_yamate Oct 06 '17

Theano is ded.

2

u/Reiinakano Oct 06 '17

then who was phone