News for hackers. Stuff that matters.
Re:Gluon – Deep Learning API from AWS and Microsoft by staticelf on Thursday October 12, 2017 @09:38AM (#15457814)
Can someone please shed light to why so many ML tools and frameworks are being implemented in Python? What makes Python so special for doing ML?

Personally, I would love for MS to release or support a .NET based ML toolkit. There is open source stuff like http://accord-framework.net but I would assume that it isn't as big nor complete as a framework being supported by a major corporation.

Re:Gluon – Deep Learning API from AWS and Microsoft by saurik on Thursday October 12, 2017 @12:29PM (#15459121)
https://jeffknupp.com/blog/2017/09/15/python-is-the-fastest-...

> Python's Buffer Protocol: The #1 Reason Python Is The Fastest Growing Programming Language Today

> The buffer protocol was (and still is) an extremely low-level API for direct manipulation of memory buffers by other libraries. These are buffers created and used by the interpreter to store certain types of data (initially, primarily "array-like" structures where the type and size of data was known ahead of time) in contiguous memory.

> The primary motivation for providing such an API is to eliminate the need to copy data when only reading, clarify ownership semantics of the buffer, and to store the data in contiguous memory (even in the case of multi-dimensional data structures), where read access is extremely fast. Those "other libraries" that would make use of the API would almost certainly be written in C and highly performance sensitive. The new protocol meant that if I create a NumPy array of ints, other libraries can directly access the underlying memory buffer rather than requiring indirection or, worse, copying of that data before it can be used.

(The italic emphasis was copied from the original article.)

Re:Gluon – Deep Learning API from AWS and Microsoft by stingraycharles on Thursday October 12, 2017 @01:18PM (#15459547)
That doesn’t sound like a very satisfying reason to me. Isn’t a ByteArrayBuffer in Java pretty much the same (its underlying implementation is a char[] which can be used directly from C)?

Is there perhaps another factor, such as an existing ecosystem or that it’s widely used in the academic field?

Re:Gluon – Deep Learning API from AWS and Microsoft by agibsonccc on Thursday October 12, 2017 @07:52PM (#15462330)
If you use direct allocation yes. Java has great facilities for direct memory management. (Look at the number of libraries like netty and co that exist). The problem with java is more the friction at getting at some of the lower level apis.

Python just has momentum and a fairly easy to use FFI.

Re:Gluon – Deep Learning API from AWS and Microsoft by pathseeker on Thursday October 12, 2017 @03:53PM (#15460805)
>Is there perhaps another factor, such as an existing ecosystem or that it’s widely used in the academic field?

Yes, it's widely used in science in general. Don't underestimate the learning curves of other languages when your audience is scientists and mathematicians. Python is incredibly easy to use, even when using numpy and other scientific tools.

Re:Gluon – Deep Learning API from AWS and Microsoft by genericpseudo on Thursday October 12, 2017 @01:31PM (#15459633)
Python has been the language of choice for many physicists (when not doing Fortran) since the early 2000s.
Re:Gluon – Deep Learning API from AWS and Microsoft by aabajian on Thursday October 12, 2017 @11:43AM (#15458788)
As a long-time Java developer, Python was a beauty. It brings back the joy of programming and makes data manipulation a breeze. C# is better than Java, but it's still not as elegant/simple/clean as Python for data science.
Re:Gluon – Deep Learning API from AWS and Microsoft by kuschku on Thursday October 12, 2017 @11:53AM (#15458862)
Python is only fun for tiny projects. Once you reach 120k LOC in a project, refactoring in Python is an insanity even with PyCharm, and debugging becomes impossible, too.

Have you tried Kotlin?

Re:Gluon – Deep Learning API from AWS and Microsoft by chirau on Thursday October 12, 2017 @12:28PM (#15459118)
Data Engineer here... How do you get to 120K LOC without splitting up your infrastructure? If anything, it is poor design on your part. Python is beautiful. I've used it at 3 different companies now, 2 of which i encouraged them to try it out and they have nothing but love for it.
Re:Gluon – Deep Learning API from AWS and Microsoft by kuschku on Thursday October 12, 2017 @12:34PM (#15459180)
Even if you split your infrastructure, have you ever tried refactoring larger projects, with many contributors, while ensuring API contracts are kept?

Without a strict and static type system it becomes quite problematic to ensure new code keeps the API contract, unless you have unit codes for every possible value.

A good type system accelerates your coding speed, compared to writing equivalent unit tests, and it improves your quality, compared to no testing.

Re:Gluon – Deep Learning API from AWS and Microsoft by tanilama on Thursday October 12, 2017 @03:20PM (#15460537)
> A good type system accelerates your coding speed, compared to writing equivalent unit tests, and it improves your quality, compared to no testing.

Coding speed is least of my concern for a ML project, to be honest. And unit tests aren't useful either, since ML by large is not deterministic. A lot u said is true for web application, but didn't really apply for a ML project

Re:Gluon – Deep Learning API from AWS and Microsoft by nielsbot on Thursday October 12, 2017 @12:42PM (#15459261)
“accelerates coding speed”

this is debatable

Re:Gluon – Deep Learning API from AWS and Microsoft by kuschku on Thursday October 12, 2017 @02:15PM (#15459973)
Well, the comparison was to writing unit tests that provide the same safety as an equivalent type system.

And compared to that, the type system is certainly faster.

Re:Gluon – Deep Learning API from AWS and Microsoft by lstmemery on Thursday October 12, 2017 @03:38PM (#15460675)
Numpy enforces type consistency within arrays. Type errors are still possible but generally rarer and are noticed sooner than base Python.
Re:Gluon – Deep Learning API from AWS and Microsoft by nielsbot on Friday October 13, 2017 @05:09PM (#15469251)
valid point
Re:Gluon – Deep Learning API from AWS and Microsoft by HelloNurse on Thursday October 12, 2017 @12:05PM (#15458959)
Once you reach 120k LOC in a machine learning project, you should have split it up into disparate projects (input adapters, interactive applications, transforming results...) many orders of magnitude ago, even in verbose and refactoring-friendly languages like Java.
Re:Gluon – Deep Learning API from AWS and Microsoft by real-hacker on Tuesday October 24, 2017 @01:06AM (#15539353)
Most deep learning programs are in the range of 100s lines of code, even for quite complicated models.
Re:Gluon – Deep Learning API from AWS and Microsoft by bertomartin on Thursday October 12, 2017 @12:00PM (#15458922)
Can you be specific on what makes this a headache? Your "refactoring" tells me that the code probably wasn't well structured in the first place and if so this would make refactoring difficult for any language, particularly dynamically typed ones.
Re:Gluon – Deep Learning API from AWS and Microsoft by grtrans on Thursday October 12, 2017 @12:08PM (#15458971)
> Your "refactoring" tells me that the code probably wasn't well structured in the first place

Well considering this is a realistic scenario for fallible humans, it’s still decent advice to keep your exploratory projects in python small to avoid ridiculous tech debt. It’s not quite as bad as with ruby, but it’s close.

Re:Gluon – Deep Learning API from AWS and Microsoft by kuschku on Thursday October 12, 2017 @12:21PM (#15459065)
I've got exactly that experience.

Many languages make it problematic to keep code actually bug-free and maintainable, and Python and especially Ruby are problematic for that, while Java and Kotlin, but even C++ (with a strict style guide) are a lot nicer to work with at scale.

If you want to keep consistent APIs between modules, strict types and checked exceptions are very helpful, while with python one typo can lead to accesses being lost — which is why so many use slots nowadays, and TypedPython, and annotations. But if I do that, I might as well use Java or Kotlin, and get a better IDE.

Compared to unit tests, strict and static types are faster, compared to no testing, static types are safer.

Re:Gluon – Deep Learning API from AWS and Microsoft by bertomartin on Thursday October 12, 2017 @02:46PM (#15460254)
I probably could have put that better, so here goes: shitty code can be a challenge to refactor regardless of language
Re:Gluon – Deep Learning API from AWS and Microsoft by tanilama on Thursday October 12, 2017 @03:03PM (#15460415)
Python in data/ml rarely goes into that scale. It is used for Training. Several thousands line per project at most, it is tractable and I don't think machine learning models really can be refactored or debugged like a web application.
Re:Gluon – Deep Learning API from AWS and Microsoft by timdorr on Thursday October 12, 2017 @10:26AM (#15458151)
Python has always had a good selection of scientific/mathematical libraries (numpy, scipy).

In addition, notebook apps like Jupyter fit well with the experimental nature of scientific code. I have a colleague who was attempting to do some stuff in Ruby (to fit with our application stack) who would leave IRB sessions open for weeks at a time. He's recently switched to Zepplin for notebook stuff, and it has been a huge productivity boost for him.

Re:Gluon – Deep Learning API from AWS and Microsoft by pm90 on Thursday October 12, 2017 @10:44AM (#15458315)
Mostly because Python is a great "glue" language. It isn't performant enough to implement the actual low-level computation, but is better at running other applications, getting data from them, feeding them into other applications (a.k.a pipelines).
Re:Gluon – Deep Learning API from AWS and Microsoft by staticelf on Thursday October 12, 2017 @11:01AM (#15458464)
Sure but if I have invested a lot in MS technologies I am hesitant to learn and implement things in a completely new language if I can find something that is more fitting to the stack I already use.
Re:Gluon – Deep Learning API from AWS and Microsoft by HelloNurse on Thursday October 12, 2017 @12:12PM (#15458997)
What relevant stack of Microsoft technology are you hoping to leverage for high performance numerical computation? Surely nothing involving .NET. Python for Windows and Python extensions can be compiled with Visual Studio; I don't see other ways to be more Microsoft-friendly.
Re:Gluon – Deep Learning API from AWS and Microsoft by nl on Friday October 13, 2017 @12:12AM (#15463227)
Sure but if I have invested a lot in MS technologies I am hesitant to learn and implement things in a completely new language if I can find something that is more fitting to the stack I already use.

The rest of the ML world is in that exact situation, but on Python. They aren't going to throw away their familiar tools unless everyone else does too.

Re:Gluon – Deep Learning API from AWS and Microsoft by losteric on Thursday October 12, 2017 @12:12PM (#15458994)
If you already have a good stack that you're very effective, the switching cost may not be worth it.

However, if you're more algorithmically focused, python is a great DSL

Re:Gluon – Deep Learning API from AWS and Microsoft by hackinthebochs on Thursday October 12, 2017 @03:32PM (#15460624)
Python is easy to pick up (coming from someone who loves the MS stack). Don't let it being a new language deter you.
Re:Gluon – Deep Learning API from AWS and Microsoft by grtrans on Thursday October 12, 2017 @12:09PM (#15458975)
It’s not clear eg what use you would get from sharing a language between your model training and request processing.
Re:Gluon – Deep Learning API from AWS and Microsoft by aswanson on Thursday October 12, 2017 @09:46AM (#15457865)
Momentum, community uptake. Python with numpy, matplotlib had the framework in place as a free alternative to the exhorbitantly priced Matlab. Community ran with it.
Re:Gluon – Deep Learning API from AWS and Microsoft by zitterbewegung on Thursday October 12, 2017 @10:52AM (#15458386)
Python had a scientific community long before even this whole new fad of Data Science. Also, financial institutions helped make software such as Pandas. The last thing is that that the syntax of the language is really friendly and easy to use with batteries included. Others have mentioned its a great glue language since it was originally designed as a systems programming language and a bunch of *nix distributions use it for that purpose.
Re:Gluon – Deep Learning API from AWS and Microsoft by alexcnwy on Thursday October 12, 2017 @12:13PM (#15459001)
Most DL researchers are more into math/stats/theory than programming and Python is faaar easier to pick up and grok than java/.net/etc.
Re:Gluon – Deep Learning API from AWS and Microsoft by othersideofcoin on Friday October 13, 2017 @01:41AM (#15463506)
It's a common denominator, few downsides, speed handled in lower level code/libs. Really good "get shit done" language, best GSD lang I've used. Scientists + programmers, data engineers and PhDs, all are cool w/ the syntax. It's open source, has a shitton of supporting libs.

Outside of speed, I've read very few valid criticisms. What other languages are cross-platform, great lib support, delegate easily to lower level libs for perf, are there?

(FWIW, any MS based language is probably excluded from consideration depending on its cross platform ability. Many data people -- like me! -- won't use a MS based OS)

Re:Gluon – Deep Learning API from AWS and Microsoft by hacking_again on Friday October 13, 2017 @01:59AM (#15463542)
Python has its share of cruft and idiosyncrasies. I find some of the syntax irritating, e.g. boolean logic, argument handling, hidden / private / magic symbols, and those pesky half-open intervals that routinely lead to off-by-one errors.
Re:Gluon – Deep Learning API from AWS and Microsoft by make3 on Thursday October 12, 2017 @12:01PM (#15458934)
According to the nips blog I think, 98% of deep learning papers are published with python source, and 1% R 1% other stuff.
Re:Gluon – Deep Learning API from AWS and Microsoft by justnikos on Friday October 13, 2017 @11:17AM (#15466429)
CNTK has C# bindings (for training) since last month (and for evaluation since forever). Also more stuff will be coming into the core C# language.
Re:Gluon – Deep Learning API from AWS and Microsoft by oh-kumudo on Thursday October 12, 2017 @02:43PM (#15460221)
Data/ML people love python, they build a great ecosystem around it for 20 years. So yes, Python is pretty special.
Re:Gluon – Deep Learning API from AWS and Microsoft by romanovcode on Thursday October 12, 2017 @10:12AM (#15458027)
Same here, kind of defeats the purpose of many libraries in my opinion if all of them are released for Python and look exactly the same. Think: front-end frameworks in javascript.