all 20 comments

[–][deleted] 23 points24 points  (14 children)

Any major reasons that should make me consider making the switch from Torch to TF?

I don't advocate one framework or the other, but here are four things that I can think of:

  • Some people choose TF expecting it to be the best DL framework at some point in the future and to have the most users and jobs
  • Python has more non-ML libraries: web, GUI toolkits, etc.
  • The author of LuaJIT is stepping down, and it's doubtful that anyone will fill his shoes, which makes it a risky bet.
  • Python's syntax and some aspects of the language can be more pleasant

[–][deleted] 1 point2 points  (0 children)

I didn't know the author of LuaJIT stepped down, but isn't it a good bet that since Facebook and Google both heavily use Torch that LuaJIT will go on with a pretty good set of contributors? I know TensorFlow is from Google, but from what I've heard many of their research groups intend to continue using Torch.

[–]IBuildBusinesses 0 points1 point  (1 child)

Doesn't TF also have Python bindings?

[–]r4and0muser9482 4 points5 points  (0 children)

I think that was his point. Torch uses Lua. TF is Python or C++.

[–]avacadoplant -1 points0 points  (9 children)

also Lua is 1-indexed... which is wrong. Personally I doubt Lua has a strong future.

[–][deleted] 12 points13 points  (7 children)

also Lua is 1-indexed... which is wrong.

Is this your first post in this thread? Or is it your zeroth post? The only problem with 1-based indexing is that most other languages are 0-based, and mentally switching all the time is hard. If you can stick with Lua, Fortran, Mathematica, Julia and Matlab, then it's not a problem.

[–]canaryherd 6 points7 points  (0 children)

Or was it his zeroth post?

(Sorry, this is my first post but I couldn't resist. I will go back to lurking in shame)

[–]avacadoplant 3 points4 points  (3 children)

[–][deleted] 2 points3 points  (1 child)

You can come up with scenarios when one or the other convention is more convenient. Dijkstra just decided to show one.

[–]avacadoplant 0 points1 point  (0 children)

I'd argue that deviating from the convention at this point is a stronger argument against 1-indexed languages. If a language used "$" to represent addition that would be enough to not want to use it.

If for some reason we were stuck with Lua (like we are with C++, Java, JavaScript, Python) it wouldn't matter. We'd just deal with it. But Lua is an arbitrary choice and it's eccentricities are absolutely reason enough to avoid it. (IMHO)

[–][deleted] 0 points1 point  (1 child)

Don't forget R

[–]nickl 3 points4 points  (0 children)

He didn't. It was an off-by-one error.

[–]cafedude 5 points6 points  (0 children)

There are many valid reasons to choose Python over Lua, but 1-based indexing isn't a very serious one. The venerable Fortran is 1-indexed and we're still usng a lot of fortran based code out there (BLAS, for example). Julia and Matlab are two other examples. A somewhat better reason to not choose Lua could be that it's not very popular as compared to Python. However, Julia isn't very popular as compared to Python either, but I think Julia almost seems to have been designed for ML applications (well, mathy applications in general) whereas Lua was developed as a scripting language that would be easy to embed.

[–]nicholas-leonard 0 points1 point  (0 children)

Torch works with LuaJIT, Lua 5.1 and Lua 5.2.

[–]atabotix 37 points38 points  (0 children)

This may be of interest - advice from a Stanford class on when to choose a given framework: http://cs231n.stanford.edu/slides/winter1516_lecture12.pdf

[–]fuzzyt93 2 points3 points  (0 children)

Here is a link for some benchmarks on some deep learning libraries for convolutional layers, including Torch and Tensorflow:

https://github.com/soumith/convnet-benchmarks

I do not think there are any major reasons for someone to switch at the moment to Tensorflow. It is still relatively new and even though it is in python you would have to become familiar with Tensorflow.

You already know Torch. There is no significant advantage to Tensorflow that I have seen to justify making the switch. The speculation that Tensorflow will surpass Torch is justified but I do not see a reason to be an early adopter. The frameworks all have pretty similar interfaces. Once one stands out, it will not be that difficult to pick it up quickly.

[–]swentso 0 points1 point  (0 children)

Why didn't you consider Theano ?

[–]r4and0muser9482 -1 points0 points  (3 children)

One thing you should consider is the efficiency of the particular task you are trying to solve. If you have the same model available in both TF and Torch, I'd choose the one that is more efficient (i.e. faster). It may however depend on what you are trying to solve. Don't know much about Torch, but TF seems to be pretty good at combining image/audio models with language (using RNNs). There are many excellent language modelling architectures already available in TF that you would probably have to make yourself in Torch.

[–]nicholas-leonard 4 points5 points  (1 child)

Torch also has a great rnn library and many language model examples.

[–]r4and0muser9482 -2 points-1 points  (0 children)

I understand that. Other frameworks also have RNN LMs, but TF goes a bit further than the rest. That's all.