TensorFlow vs Theano
When comparing TensorFlow vs Theano, the Slant community recommends Theano for most people. In the question“What are the best artificial intelligence frameworks?” Theano is ranked 1st while TensorFlow is ranked 2nd. The most important reason people chose Theano is:
Theano is a Python library which is very well adapted for numerical tasks often encountered when dealing with deep learning. What makes it well adapted for those tasks is the fact that it combines several paradigms for numerical computations, namely: matrix operations symbolic variable and function definitions Just-in-time compilation to CPU or GPU machine code
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Easily spin up sessions without restarting the program
TensorFlow can run with multiple GPUs. This makes it easy to spin up sessions and run the code on different machines without having to stop or restart the program.
Pro Ensured continued support
TensorFlow is developed and maintained by Google. It's the engine behind a lot of features found in Google applications, such as:
- recognizing spoken words
- translating from one language to another
- improving Internet search results
Making it a crucial component in a lot of Google applications. As such, continued support and development is ensured in the long-term, considering how important it is to the current maintainers.
Pro Visualization suite available
Google has made a powerful suite of visualizations available for both network topology and performance.
Pro Python has a lot of powerful scientific libraries available
Other than having an easy syntax, using Python also gives developers a wide range of some of the most powerful libraries for scientific calculations (NumPy, SciPy, Pandas) without having to switch languages.
Pro Safe choice
Safest choice out there.
Pro Great debugging potential
You can introduce and retrieve the results of discretionary data on any edge of the graph. You can also combine this with TensorBoard (suite of visualization tools) to get pretty and easy to understand graph visualizations, making debugging even simpler.
Pro Written in Python, which is regarded as a really pleasant language to read and develop in
TensorFlow is written in Python, with the parts that are crucial for performance implemented in C++. But all of the high-level abstractions and development is done in Python.
Pro Well adapted for numerical tasks
Theano is a Python library which is very well adapted for numerical tasks often encountered when dealing with deep learning.
What makes it well adapted for those tasks is the fact that it combines several paradigms for numerical computations, namely:
matrix operations
symbolic variable and function definitions
Just-in-time compilation to CPU or GPU machine code
Pro Optimized for both CPU and GPU
Since all variables are actually symbolic variables, you need to define a function and fill in the values in order to get a value. For example:
# X, y and w are a matrix and vectors respectively
# E is a scalar that depends on the above variables
# to get the value of E we must define:
Efun = theano.function([X,w,y],
E,allow_input_downcast=True)
While this seems like an unnecessary step, it's actually not. Since Theano now has a representation of the whole expression graph for the Efun function, it can compile and optimize the code so that it can run on both CPU and GPU.
Cons
Con Not fully open source
For now, Google has only open sourced parts of the AI engine, namely some algorithms that run atop it. The advanced hardware infrastructure that drives this engine is not "open source".
Con Somewhat low level on its own
Theano is one of the oldest deep learning libraries out there and a lot of other widely used libraries have been built on top of it.
But Theano heavily relies on the mathematical side of deep learning and data discovery, having similar features to NumPy or Matlab. This is why it's usually used with other libraries in order to achieve a higher level of abstraction.
