News for hackers. Stuff that matters.
Re:TensorFlow: open-source library for machine intelligence by Schiphol on Monday November 09, 2015 @09:14AM (#10533075)
> The TensorFlow Python API requires Python 2.7

The whole scientific Python stack is available for Python 3. This seems like a somewhat backwards thing to do -- or perhaps the requirement is intended to mean at least 2.7?

Edit: added context

Edited again: More careful wording

Re:TensorFlow: open-source library for machine intelligence by vrv on Monday November 09, 2015 @09:23AM (#10533136)
We're looking to support Python 3 -- there are a few changes we are aware of that are required, and we welcome contributions to help!

Tracking here: https://github.com/tensorflow/tensorflow/issues/1

Re:TensorFlow: open-source library for machine intelligence by Schiphol on Monday November 09, 2015 @09:26AM (#10533149)
Thanks for a constructive reply to a (well-meaning, but) not very nice comment!

Congrats on the library, which looks awesome.

Re:TensorFlow: open-source library for machine intelligence by witty_username on Monday November 09, 2015 @12:21PM (#10534325)
Criticism is considered "not very nice"? Your initial comment wasn't impolite or anything.
Re:TensorFlow: open-source library for machine intelligence by cdnsteve on Monday November 09, 2015 @09:54AM (#10533305)
Python 3 is very much needed! <3 because it's issue #1 :)
Re:TensorFlow: open-source library for machine intelligence by sandGorgon on Monday November 09, 2015 @02:02PM (#10535031)
is this compatible with pypy (or plan to be). Pypy is such an awesome project, done on such a small budget that it needs some well deserved love !
Re:TensorFlow: open-source library for machine intelligence by kragen on Monday November 09, 2015 @09:26AM (#10533153)
This "backwards" meme doesn't make any sense. Python 2 and Python 3 are different languages that happen to share the same name, a lot of syntax, and near-source compatibility, but they've been developed concurrently for ten years now. It's kind of like C and C++. If the current Python 2 team (which is part of the Python Software Foundation) abandons it, probably somebody else will take over maintenance, because it seems unlikely that it will fall out of use.

If the Python Software Foundation drops the ball, someone else will pick it up.

Re:TensorFlow: open-source library for machine intelligence by nonelement on Monday November 09, 2015 @09:41AM (#10533243)
Let me start by saying I understand what you're saying. I understand why what you're saying is true. However, many people see (and consequently think) this:

"Short version: Python 2.x is legacy, Python 3.x is the present and future of the language"

... which was lifted from https://wiki.python.org/moin/Python2orPython3. It follows that some people would think something along the lines of "...so this library was built for legacy Python?"

Re:TensorFlow: open-source library for machine intelligence by asdfologist on Monday November 09, 2015 @09:42AM (#10533248)
The Python Software Foundation has stated explicitly that Python 2.7 will EOL in 2020...
Re:TensorFlow: open-source library for machine intelligence by vegabook on Monday November 09, 2015 @10:38AM (#10533583)
...but the science guys have been offered zero incentive to move, this "end of life" argument has been worked to death without success, and so it's perhaps time to shift focus to the science community's real needs (ie: GPU).
Re:TensorFlow: open-source library for machine intelligence by Nrpf on Monday November 09, 2015 @11:23AM (#10533890)
Check out Dynd.
Re:TensorFlow: open-source library for machine intelligence by 1ris on Monday November 09, 2015 @11:44AM (#10534030)
Python 2 is dead.
Re:TensorFlow: open-source library for machine intelligence by arcanus on Monday November 09, 2015 @02:19PM (#10535137)
Like it or not, it is very much not dead.
Re:TensorFlow: open-source library for machine intelligence by vegabook on Monday November 09, 2015 @12:33PM (#10534409)
hmmm. Google does not seem to agree. Your assertion is a wish not a fact. Dogmatic 3.x people are being shown, yet again, the uncomfortable, brutal truth, that 3.x is not happening in science.

Seriously. If you're advising someone considering Python on the 2 v 3 question today, how can you not tell them that possibly one of the most important new machine learning libraries, only works on 2.7.

Re:TensorFlow: open-source library for machine intelligence by cossatot on Monday November 09, 2015 @02:27PM (#10535189)
First off, 3.x is happening in science. I'm a scientist, and I use 3.x, and as of this fall, every single scientific package that I use has been ported to 3.x. Using @ for matrix multiplication is also a pretty big deal to me.

It's worth remembering that most scientists don't do any machine learning, because it's not all that useful in many domains. A lot of science is trying to find an explanatory model for the observations. Machine learning is much better at finding a good predictive model for the observations that may not offer any insight to what is happening behind the scenes.

Re:TensorFlow: open-source library for machine intelligence by vegabook on Monday November 09, 2015 @04:21PM (#10535925)
Yes - I have also moved (a holdout library was ported recently). I even liked it. But here I am thinking about moving backward again after having crossed that rubicon.

Three's problem is that even if 95% of stuff is on it, basically 100% of stuff is on 2.7, including brand new stuff. Let's say you use 10 libraries on average and 95% of libraries have been ported. The odds of having one library missing are still 40%! (1-0.95^10) This ratio goes up the more specialised your work, or the greater your investment in legacy, which is why most 3.x people are generalists/web where they cannot understand the 2.x position. For me this Tensorflow library transports me right back into exactly that 40% problem. That problem does not exist the other way around unless you at all costs need to use Asyncio instead of something that's already been there for years.

In my case I'm going to persevere and put 2.7 back into a virtualenv or something but it's really not ideal and my point is still that if 3.x gave science/engineering people something properly compelling (@ operator is not enough in my view) then the above problem would not be happening.

For example a difficult-but-possible megawin would be to put GPU computing natively into Python. GPU is more than 50% of the compute silicon in most computers nowadays (Iris 6200 uses up 50% of die size in recent Intel core i7). If you include multicore and discrete GPU then standard Python is only targeting about 10% of the available compute silicon in a modern PC! Imagine how very rapidly everybody would move if there were a GPU-enabled Numpy array in 3.6.

Re:TensorFlow: open-source library for machine intelligence by vegabook on Monday November 09, 2015 @09:27AM (#10533157)
I am really excited about this library. Tensors are the future; matrices are going to look so old in a few years. In fairness, Theano already knew that. I cannot wait to dig into this and am very relieved that Google's best are still using Python for this endeavour...but...using Python 2.7.

I have just recently been persuaded by the community that 3.5 is cost free, and here I have this enormous counterexample. For the science guys, clearly, the message is not getting through, and I'm not surprised: 3.x offers them nothing. Hence they're blissfully continuing with 2.7.

So I guess I'll have to run two Pythons on my system. Not the ideal situation.

Now if Python 3.(x > 5) would give us native GPU, which might require putting (a GPU-enabled) Numpy into the standard library...as opposed to, say, spending 2 years re-inventing Tornado....

Re:TensorFlow: open-source library for machine intelligence by pathsjs on Monday November 09, 2015 @10:41AM (#10533610)
> Tensors are the future; matrices are going to look so old in a few years.

I am honestly curious about this point of view. Is there any example where actual multidimensional tensor have any relevance? What I mostly see around is just standard linear algebra operations on matrices and vectors lifted to higher-dimensional tensors point-wise (for instance applying a certain operation to all 2-dimensional subtensors of a given tensor).

I never saw the need for modeling matrices in terms of tensors - the latter seem just more complex to use and usually tensor operations (like symmetrization, antisymmetrization, wedge products...) are not even available in libraries

(And by the way, both matrices and tensors are now more than one century old...)

Re:TensorFlow: open-source library for machine intelligence by mjw on Monday November 09, 2015 @04:57PM (#10536115)
> What I mostly see around is just standard linear algebra operations on matrices and vectors lifted to higher-dimensional tensors point-wise

Equally what is matrix multiplication but a bunch of 1-dimensional dot products applied pointwise? why do we need matrices?

I do get what you're saying, and that part of it is that ML / CS folk just use 'tensor' as a fancy word for a multi-dimensional array, whereas physics folk use the word for a related coordinate-basis-independent geometric concept. But for numerical computing broadcasting simple operations over slices of some big array is really useful thing to be able to do fast and to express concisely.

Numerics libraries which don't bother to generalise arrays beyond rank 1 and 2 always feel rather inelegant and limiting to me. Rank 3+ arrays are often really useful (images, video, sensory data, count data grouped by more than 2 factors, ...), and lots of operations generalise to them in a nice way. Good array programming environments (numpy, torch, APL take advantage of this to provide an elegant general framework for broadcasting of operations without ugly special cases.

Re:TensorFlow: open-source library for machine intelligence by alextgordon on Monday November 09, 2015 @08:05PM (#10536976)
The traditional pure mathematical of looking at it is that vectors are members of a vector space. Matrices are linear maps, and matrix multiplication is composition of linear maps.

So what algebraic concept do tensors correspond to?

Re:TensorFlow: open-source library for machine intelligence by jwmerrill on Monday November 09, 2015 @08:26PM (#10537043)
Multilinear maps. You can view contraction with a vector (a dot product) as mapping a vector into the scalars, contraction with a matrix as mapping two vectors into the scalars, and contraction with a tensor as mapping several vectors into the scalars. You don't always have to contract all the indices at once, so with a rank m tensor, you can map n vectors into a collection of m - n vectors.
Re:TensorFlow: open-source library for machine intelligence by vegabook on Monday November 09, 2015 @10:46AM (#10533653)
In my domain (finance) correlations between vectors are unstable but (maybe) dependent on cross-sectional relationships in the problem space. Some of the mathematics behind elastic body deformation (car tyres in in mechanical engineering, fluid dynamics in weather forecasting) have high applicability. Tensors are required.

It's true that tensors are hard to reason about - they overclock my brain most of the time - but there is no doubt that, just like moving from scalars to vectors massively increases your real-world modelling power, so does the natural extrapolation to matrices, and from there, tensors.

Re:TensorFlow: open-source library for machine intelligence by pathsjs on Monday November 09, 2015 @12:03PM (#10534175)
It's not that tensors are particularly hard to reason about. It's just that the way they are represented as multidimensional arrays hides very well the fact that they are element of a tensor product (hence tensors). Natural operations like, well, the tensor product are often not even available.
Re:TensorFlow: open-source library for machine intelligence by vegabook on Monday November 09, 2015 @01:21PM (#10534736)
I agree that tensors are often used simply as a convenient representation for multiple lower-dimensional objects. I suspect that is because there is still plenty of value in many fields, including mine, in exploring scalar, vector, and matrix representations of problems, and tensors are often unexploited. They're used as convenient data structures, not as algorithmic necessities. Still, as more and more people have access to data and explore it, increasing competition, reducing the "alpha" of simpler analyses, moving deeper into dimensionality on algorithms will be the only choice for those who want to innovate, is my view. So it is probably necessary to have the tools at our disposal already.
Re:TensorFlow: open-source library for machine intelligence by varelse on Monday November 09, 2015 @10:19PM (#10537414)
>Tensors are the future

"Tensor said the tensor. Tension, apprehension, And dissension have begun."

https://en.wikipedia.org/wiki/The_Demolished_Man

Tensors were the future even before they were cool.

Re:TensorFlow: open-source library for machine intelligence by jdiez17 on Monday November 09, 2015 @09:19AM (#10533101)
It's open source, so feel free to port it to Python 3.
Re:TensorFlow: open-source library for machine intelligence by pacala on Monday November 09, 2015 @10:44AM (#10533636)
It has a C++ API, so there is no lock-in to Python, either 2.7 or 3.x.
Re:TensorFlow: open-source library for machine intelligence by gbrown on Monday November 09, 2015 @12:19PM (#10534299)
It looks like the C++ API is for executing graphs only, which is kind of odd.