Earlier quoted context omitted.
Maybe less readable than I remembered, sorry! But these `CartesianIndex` things are how you index multi-dimensional arrays. If by indexing you only mean adding offsets to pointers with your bare hands, this is possible but discouraged. Because you'll produce a buggier and less general version of exactly what already exists. In this case, reversing an N-dimensional array, along any M of its axes, with arbitrary offset…
What I mean is something like this: # one dimensional a = [1, 2, 3] # prints the number 1 @ index 0 print(a[0]) # multi-dimensional b = [[1, 2, 3], [4, 5, 6]] # prints the number 4 @ index (1, 0) print(b[1][0]) In Julia these indexes would start from 1. It doesn't seem like `CartesianIndex` solves this, since looking at some examples you still have to specify array indexes (Which start from 1): https://docs.julialang…
Swift for TensorFlow Shuts Down
371–380 of 432 posts
Re: Swift for TensorFlow Shuts Down
#372Earlier quoted context omitted.
More like... most of the scientific Python stack has settled on a third party library, NumPy, to provide support for numerical computing. That includes providing data types like arrays. Tensorflow doesn't use NumPy's data types, so if you want to use Tensorflow Probability, you need to convert everything you've done in NumPy (or things that are built on top of NumPy, like Pandas) to TensorFlow, and use TensorFlow's f…
https://www.tensorflow.org/guide/tf_numpy
Re: Swift for TensorFlow Shuts Down
#373Earlier quoted context omitted.
I agree with you, although I must say that as an occasional Python user the way type hints are implemented absolutely baffles me. In particular the fact that they are completely ignored by the standard implementation. They're glorified comments. Given how opinionated the Python maintainers can be, it baffles me that they accepted to get these optional, noisy, half backed type hints into the core language. In my exper…
My view is completely opposite to yours. I find type hints extremely useful and every new line of Python code I write uses them. I finally no longer have to do type checking / duck typing in my head but can simply write the types down. Moreover, an IDE like PyCharm will then do the type checking for me, notifying me of potential errors. (Even if I decide not to use Mypy.) Third, I finally only need to look at the sig…
Writing type hinted python in Pycharm or Ipython feels like racing in a sports car. Without it, feels like stop and go traffic with the occasional car accident.
I can see how if you are using a WYSIWYG editor, type hints feel like more text for little gain. But even then, it really helps document intent. In fact switching to IDEs is partly what made me go from someone who hated static typing to loving it.
Re: Swift for TensorFlow Shuts Down
#374Earlier quoted context omitted.
It fundamentally can't be improved in a significant enough way and still be Python. The more realistic options are to be okay with Python's type system (I personally am) or to look at different languages if you really want something more robust.
I agree with you, although I must say that as an occasional Python user the way type hints are implemented absolutely baffles me. In particular the fact that they are completely ignored by the standard implementation. They're glorified comments. Given how opinionated the Python maintainers can be, it baffles me that they accepted to get these optional, noisy, half backed type hints into the core language. In my exper…
This was always kinda false (type hints can be composed unlike eg docstring param @type). But with the introduction of dataclass, this is empirically false. You can readily hook into the type hints, reflect on them, use it to marshal data, etc. Using __post_init__, you can leverage any kind of runtime checks you want to enforce invariants.
Also type hints greatly help transpilation.
You don't need 100% to reap the benefits. In fact I will annotate small bits of un-typed code and it makes it way easier to reason about.
Re: Swift for TensorFlow Shuts Down
#375Earlier quoted context omitted.
Swift has no traced garbage collector which means you cannot represent circular data structure/references. Also swift support for interfaces (protocol) is sub-par with today standards
> Also swift support for interfaces (protocol) is sub-par with today standards interesting, what could be added/changed to make it better?
There might be workarounds but for a newcomer, this is a red flag of reinventing a basic and universal construct (interfaces) in a sub-par one, this show a dangerous mentality from the swift vm devs, what else did they wrongfully reinvent in a sub-par way?
Re: Swift for TensorFlow Shuts Down
#376Back when I was doing a lot of Swift programming, this seemed like such a great idea. Since then I moved on to Julia. And when I looked at the ML code for Swift and compared it to Julia, I was thinking "How on earth could anyone think this was ever a good idea?" Doing machine learning stuff in Julia is simply much more user friendly than doing the same in Swift. Swift is nice for iOS development, but I think in data…
This is actually the other way around -- Method JITs are harder to implement and all the major JavaScript JITs are method JITs, not tracing JITs. There are many reasons that contribute to the latency but I don't see what makes method JITs inherently slower than tracing JITs.
Re: Swift for TensorFlow Shuts Down
#377Earlier quoted context omitted.
> It's definitely not possible. These have to be rewritten with the specific autodiff /ML framework in mind. I don't understand why it's not possible. You're asking if it's possible in the language. I don't see anything stopping you from, as you say, writing your own framework, or simply doing it in TF. Perhaps my ignorance of Julia is showing :)
Admittedly it is a bit hard to see why Julia is so different in this area if you have not spent some with it. It took me a bit time as well to see. But there really is a profound difference. The thing is that Python is really just a language to rearrange networks of nodes written in C++. A node written for one ML framework will be incompatible with a node written in another language. If you want them to work together…
I don’t much use Julia, but it is a beautiful language. I started a tiny side project for using Julia for non-numerical things like querying SPARQL endpoints, text processing, etc. Julia could be a universal, use for almost everything language.
Re: Swift for TensorFlow Shuts Down
#378Earlier quoted context omitted.
Scala already has a foothold on the same research domain due to large data frameworks like Hadoop and Spark, with NVidia caring for polyglot support on CUDA, including JVM based languages.
That is true, and certainly relevant, but I believe it is also true that Scala does not meet the criteria for what that were trying to do, because it is not easy (perhaps not possible) to do the kind of static analysis necessary to achieve their goals. For a generic "what language with a good type system should we use with ML?" project, I would totally agree with you that Scala is an obvious choice. But this project…
There is a paper published in 2019 from Purdue University where they show how AD can be combined with multi-stage programming in Scala. [1]
DeepLearning.scala that does compile-time reverse AD. [2]
Compute.scala for operator fusion at runtime (JITifying) [3]
Here [4] is a Pre-SIP to add reifiable control flow to Scala compiler so AD and operator fusion could happen at compile-time.
Moreover, Kotlin also has a library that does type-safe AD. [5]
nVidia and Oracle want better interopabiltiy between CUDA and GraalVM through grCuda. [6]
[1] Demystifying Differentiable Programming: Shift/Reset the Penultimate Backpropagator - https://arxiv.org/pdf/1803.10228.pdf
[2] https://github.com/ThoughtWorksInc/DeepLearning.scala
[3] https://github.com/ThoughtWorksInc/Compute.scala
[4] https://contributors.scala-lang.org/t/pre-sip-for-with-contr...
[5] https://github.com/breandan/kotlingrad
[6] https://developer.nvidia.com/blog/grcuda-a-polyglot-language...
Re: Swift for TensorFlow Shuts Down
#379Back when I was doing a lot of Swift programming, this seemed like such a great idea. Since then I moved on to Julia. And when I looked at the ML code for Swift and compared it to Julia, I was thinking "How on earth could anyone think this was ever a good idea?" Doing machine learning stuff in Julia is simply much more user friendly than doing the same in Swift. Swift is nice for iOS development, but I think in data…
Re: Swift for TensorFlow Shuts Down
#380Earlier quoted context omitted.
Sure, but isn't it nice that you don't even have to read the paper to play with the full model, to see if the claims hold up, using the same Python tools you and everyone else uses?
To be honest that is not really true for many ML implementations from papers. Often, I will pull a repo and it will be half-baked, or, only works on python 2.4, or have a broken dependency on something or another (zmq was common issue for a hot sec), or not publish weights, or be in tf when I want torch, or be in torch when I want tf, etc.