Live data from Hacker News

Keras vs PyTorch

deepsense.ai

51–60 of 119 posts

Re: Keras vs PyTorch

#52
post #47
post #34

Earlier quoted context omitted.

> Kind of reminds me of assembly programmers that thought C wasn't for l33t 10xx pwner programmers. The problem with TensorFlow is mainly that you, as a user, have to build a data-dependency graph. This is something a C compiler can do very well, but Python is not so suitable for that. So, in my view, TensorFlow chose the wrong substrate for their "more efficient" library. Instead, they should have developed their ow…

> So, in my view, TensorFlow chose the wrong substrate for their "more efficient" library. Instead, they should have developed their own language, where the whole data-flow graph determination could be implicit, and not a concern for the programmer. You just described Swift for TensorFlow.

> You just described Swift for TensorFlow

This one? https://www.tensorflow.org/api_docs/swift/

Re: Keras vs PyTorch

#53
post #27

I don't do much ML (this kind of ML at least), so I know I'm not the target audience for these libraries. But I'd wish they were written in some language with static typing for IDE help. The API interface/tweaks-to-be-done for some of them is enormous, and mostly undiscoverable. I mean, just looking at the "getting started, 30 seconds to Keras"[0], there are so many magic strings and options. Of course, if one is wel…

Try DeepLearning4J, it's based on Java, and is pretty kick-ass.

Re: Keras vs PyTorch

#54
post #47
post #34

Earlier quoted context omitted.

> Kind of reminds me of assembly programmers that thought C wasn't for l33t 10xx pwner programmers. The problem with TensorFlow is mainly that you, as a user, have to build a data-dependency graph. This is something a C compiler can do very well, but Python is not so suitable for that. So, in my view, TensorFlow chose the wrong substrate for their "more efficient" library. Instead, they should have developed their ow…

> So, in my view, TensorFlow chose the wrong substrate for their "more efficient" library. Instead, they should have developed their own language, where the whole data-flow graph determination could be implicit, and not a concern for the programmer. You just described Swift for TensorFlow.

isn't work in progress ? https://github.com/tensorflow/swift/blob/master/docs/WhySwif...

Re: Keras vs PyTorch

#55
Nice article, and I agree with the explanations of what makes Keras and TensorFlow best for specific use cases. Some history: I have used TensorFlow for years, switched to coding against the Keras APIs about 8 months ago. I wish I had more experience with PyTorch, but I just have the time right now to do more than just play with it.

One suggestion to the authors: the benchmark figures are interesting, but I wish you had shown CPU only results also. At work, I have all the GPU resources I need but for my home projects, which are all NLP deep learning experiments, I usually rent a many core large memory server with no GPUs (GPUs seem to speed up RNNs less than other model types).

Re: Keras vs PyTorch

#56
post #2

Author here - the article compares Keras and PyTorch as the first Deep Learning framework to learn. It explores the differences between the two in terms of ease of use, flexibility, debugging experience, popularity, and performance, among others. If you have experience with learning, or teaching Deep Learning with PyTorch or Keras, we’d love to hear your thoughts about them.

For what it's worth, here's my experience:

My adviser decided (wisely) that we all needed to learn NN, and we settled on Tensorflow. That went... poorly. I've told this before: the Seq2Seq tutorial was designed for an older version of TF, and it triggered a bug that was not fixed because that way to do Seq2Seq was deprecated and a new tutorial was coming "soon". The "tutorial" was also just a code dump with barely any comments.

Eventually we had new people coming in with even less theoretic background than ours (we had read papers for at least 6 months), and that's when we realised it would not work at all. So we organised a 1-week hackathon with Pytorch, and we've been using it ever since.

Re: Keras vs PyTorch

#57
post #47
post #34

Earlier quoted context omitted.

> Kind of reminds me of assembly programmers that thought C wasn't for l33t 10xx pwner programmers. The problem with TensorFlow is mainly that you, as a user, have to build a data-dependency graph. This is something a C compiler can do very well, but Python is not so suitable for that. So, in my view, TensorFlow chose the wrong substrate for their "more efficient" library. Instead, they should have developed their ow…

> So, in my view, TensorFlow chose the wrong substrate for their "more efficient" library. Instead, they should have developed their own language, where the whole data-flow graph determination could be implicit, and not a concern for the programmer. You just described Swift for TensorFlow.

Well, apparently :) They say: We believe that machine learning tools are so important that they deserve a first-class language and a compiler.

However, I'd like to see some numbers on how more efficient it is to build a graph in advance, given that the lion's share of the computations will be in tensor math anyway (which can be heavily optimized, and is independent of the graph).

Re: Keras vs PyTorch

#58
post #45
post #27

I don't do much ML (this kind of ML at least), so I know I'm not the target audience for these libraries. But I'd wish they were written in some language with static typing for IDE help. The API interface/tweaks-to-be-done for some of them is enormous, and mostly undiscoverable. I mean, just looking at the "getting started, 30 seconds to Keras"[0], there are so many magic strings and options. Of course, if one is wel…

I've been recently following the course over at fast.ai and I'm having the same issue. The API is, as you mentioned, undiscoverable, and I don't really want to look at the source code, which is kind of unreadable anyway ([0]). The course itself is littered with poorly readable code ([1]) such as: to_np(m.ib(V(topMovieIdx))) Why, just why. Despite all this, I wholeheartedly recommend this course, it demystified DL for…

I kind of agree. I find the way the fastai library (which builds on PyTorch) is written does not match my personal preferences very well. That being said I still really enjoy working with it and the courses do guide one along quite well. I'd actually recommend it for anyone who just wants to get started and play around. It's fairly easy to get good results on a gaming box (say 1080 GTX) reasonably quickly. I also like the Jupyter Notebook approach that they use for the lectures. It encourages experimenting around and they also encourage you to dive into the library and read source code which is good. Alas I find the terse style complicates it a bit but that may very well be personal preference. It's also good to know that they try to implement interesting papers quickly.

I think overall if your goal is to use a preexisting architecture to get quick results fastai is a great point to start. If you want to build your own architecture, reach one level of abstraction lower. Edit: I liked this PyTorch youtube series quite a bit: https://www.youtube.com/watch?list=PLlMkM4tgfjnJ3I-dbhO9JTw7...

Re: Keras vs PyTorch

#59
I don't know about how many people external to Google know about tf.estimator, but it's where most people who aren't building complicated custom architectures should be starting. Keras is nice, it's easy to use, but I wouldn't use it to design build and run a massive productive pipeline. tf.estimator is just that.

Re: Keras vs PyTorch

#60
post #45
post #27

I don't do much ML (this kind of ML at least), so I know I'm not the target audience for these libraries. But I'd wish they were written in some language with static typing for IDE help. The API interface/tweaks-to-be-done for some of them is enormous, and mostly undiscoverable. I mean, just looking at the "getting started, 30 seconds to Keras"[0], there are so many magic strings and options. Of course, if one is wel…

I've been recently following the course over at fast.ai and I'm having the same issue. The API is, as you mentioned, undiscoverable, and I don't really want to look at the source code, which is kind of unreadable anyway ([0]). The course itself is littered with poorly readable code ([1]) such as: to_np(m.ib(V(topMovieIdx))) Why, just why. Despite all this, I wholeheartedly recommend this course, it demystified DL for…

I've never seen this code before: to_np(m.ib(V(topMovieIdx)))

but I can guess that topMovieIDx is the index of the top movie, V converts to a vector(?), dunno about m.ib, and to_np is converted to a numpy array.

Post reply on HN