Automatic Differentiation with Julia
41–50 of 83 posts
Re: Automatic Differentiation with Julia
#42For those curious about Julia, I just found this: https://www.infoworld.com/article/3284380/data-science/what-... Close to C speed in a dynamic language? Seems pretty great on paper. Is this generally the case?
the catch is, the first time you run a function there is often a noticeable compile time. but it’s cached after that.
other problems with Julia include a somewhat immature/unfinished set of libraries, in part because the language was constantly changing underneath people.
but now that 1.0 has been released, the language will be stable for a long time and you can expect that to improve quickly.
good language! it gets a lot of hype on HN but that’s because it is actually very nice.
Re: Automatic Differentiation with Julia
#43Julia is a great language, but I'm still waiting for someone to create a Julia fork that uses 0-based indexing.
Hear hear. Everyone that's making excuses for one based is wrong. You need a zero in your set of integers to form a Ring modulo N. I hereby declare everyone that wants 1 based indexing out of some naive sense of it being easier a scrub.
Re: Automatic Differentiation with Julia
#44For those unaware of what automatic differentiation is: It's a close-to-magical tool which turns code for evaluating a function f into code for evaluating its derivative f'. It uses a special sort of invented numbers which square to zero even though they are not themselves zero. Here is one of the many tutorials on automatic differentiation: https://pizzaseminar.speicherleck.de/automatic-differentiati...
To clarify, your statement that, "It uses a special sort of invented numbers which square to zero even though they are not themselves zero." is not entirely true. In case someone else is looking at this, what the OP is referring to is dual numbers. That is one way to implement things, but not the most common way for fast tools. Fundamentally, automatic differentiation is the methodical application of the chain rule.…
Besides efficiency concerns (which I don't have a clue about), a disadvantage of the point of view using dual numbers is that, to my knowledge, it can only be used to derive the forward mode of automatic differentiation. Still I take pleasure in appreciating the slightly mystic aura of the dual numbers. :-)
Re: Automatic Differentiation with Julia
#45For those unaware of what automatic differentiation is: It's a close-to-magical tool which turns code for evaluating a function f into code for evaluating its derivative f'. It uses a special sort of invented numbers which square to zero even though they are not themselves zero. Here is one of the many tutorials on automatic differentiation: https://pizzaseminar.speicherleck.de/automatic-differentiati...
Thid is really neat. Is this really used in practice? It seems to me that most of the AD frameworks used for deep learning implement the backward function that returns the jacobian for every initial function, and then chain those backward functions
Though I have never seen AD frameworks used in the production contexts for neural networks/backpropagation. As you say, the code for this seems to be mostly handrolled. Please take this negative statement with a grain of salt, I don't actually work in machine learning.
Re: Automatic Differentiation with Julia
#46Julia is a great language, but I'm still waiting for someone to create a Julia fork that uses 0-based indexing.
Hear hear. Everyone that's making excuses for one based is wrong. You need a zero in your set of integers to form a Ring modulo N. I hereby declare everyone that wants 1 based indexing out of some naive sense of it being easier a scrub.
Re: Automatic Differentiation with Julia
#47Earlier quoted context omitted.
Hear hear. Everyone that's making excuses for one based is wrong. You need a zero in your set of integers to form a Ring modulo N. I hereby declare everyone that wants 1 based indexing out of some naive sense of it being easier a scrub.
That's so absurd I hope it's satire. Humans instinctively reason about iteration in terms of the natural numbers, not the semantic purity of the underlying abstract algebra.
Re: Automatic Differentiation with Julia
#48For those unaware of what automatic differentiation is: It's a close-to-magical tool which turns code for evaluating a function f into code for evaluating its derivative f'. It uses a special sort of invented numbers which square to zero even though they are not themselves zero. Here is one of the many tutorials on automatic differentiation: https://pizzaseminar.speicherleck.de/automatic-differentiati...
Re: Automatic Differentiation with Julia
#49Earlier quoted context omitted.
That's so absurd I hope it's satire. Humans instinctively reason about iteration in terms of the natural numbers, not the semantic purity of the underlying abstract algebra.
It's not absurd at all. In situations where you need to do modulo arithmetic on array indices 1-based indexing forces you to shift the offset by 1.
Re: Automatic Differentiation with Julia
#50For those curious about Julia, I just found this: https://www.infoworld.com/article/3284380/data-science/what-... Close to C speed in a dynamic language? Seems pretty great on paper. Is this generally the case?
As long as you write code that's type stable, yea. Type stable means that the compiler can deduce the types of the variables used in a function given the types of the arguments passed to the function. An example of code that's not type stable is code something like this: function test1(n) x = 0 for i = 1:n if i == 10 x = x + 0.1 else x = x + 1 end end return x end It isn't type stable because x starts out as an int b…
julia> @btime test1(10^5)
147.427 μs (0 allocations: 0 bytes)
99999.1
julia> @btime test2(10^5)
88.472 μs (0 allocations: 0 bytes)
99999.1
In earlier versions of Julia, the penalty here would be order of magnitudes worse.