Live data from Hacker News

Nilang.jl – A Reversible Julia DSL

github.com

1–10 of 31 posts

Re: Nilang.jl – A Reversible Julia DSL

#5
post #2

Incredible. Given a (one-to-one) Julia function `f`, this package generates `~f`, the inverse of f. Clever use of automatic differentiation. Paper: https://arxiv.org/abs/2003.04617

Forgive my ignorance, but what applications would this be used in where just maintaining copies of the initial parameters to f() wouldn’t work?

Re: Nilang.jl – A Reversible Julia DSL

#6
post #4

Wait a second, does it yield an exact inverse or a numerical approximation?

Given the example of reversing over a function that calculates the first Fibonacci number greater than 100, it seems to be a bit more going on than "just" a numerical approximation:

https://github.com/GiggleLiu/NiLang.jl/blob/master/examples/...

Ed: after skimming the paper (that went mostly over my head) - this does indeed seem to be about "actually" running functions in reverse - given a function only defined "forward" in the nilang DSL. It appears the graph embed examples are missing in the master branch, unfortunately.

I wonder if this can be used more trivially to solve simple problems too - like calculating values/sums pertaining to compound interest/investment, given a naive function for calculating sums etc (its trivial to add up compounded interest and deposits, but a tiny bit more complicated to answer the question "at what time is my portfolio at X or more dollars).

Re: Nilang.jl – A Reversible Julia DSL

#7
post #2

Incredible. Given a (one-to-one) Julia function `f`, this package generates `~f`, the inverse of f. Clever use of automatic differentiation. Paper: https://arxiv.org/abs/2003.04617

Forgive my ignorance, but what applications would this be used in where just maintaining copies of the initial parameters to f() wouldn’t work?

I think the space requirements are different.

Even if you only care about previous applications of f. Keeping snapshots of every input isn't always feasible.

Re: Nilang.jl – A Reversible Julia DSL

#8
post #7

Earlier quoted context omitted.

Forgive my ignorance, but what applications would this be used in where just maintaining copies of the initial parameters to f() wouldn’t work?

I think the space requirements are different. Even if you only care about previous applications of f. Keeping snapshots of every input isn't always feasible.

I think the core idea is that it actually gives you an inverse function, based on your regular (in the DSL) function definition.

There's as far as I can tell no inherent need to call the regular function first - given any function f, you get a callable inverse function ~f.

Re: Nilang.jl – A Reversible Julia DSL

#9
post #2

Incredible. Given a (one-to-one) Julia function `f`, this package generates `~f`, the inverse of f. Clever use of automatic differentiation. Paper: https://arxiv.org/abs/2003.04617

Forgive my ignorance, but what applications would this be used in where just maintaining copies of the initial parameters to f() wouldn’t work?

Very interesting. Not read the paper yet, but plan to.

Reversibility is important in quantum computing. Quantum circuits must transform input to output in a "unitary" manner, which is reversible. If you consider the input to output as a linear transformation matrix (with complex values), then the complex conjugate of the matrix gives the "inverse function".

This is probably useless info, but reversibility in the classical sense is also interesting due to the energy bounds of computation. The Landauer limit (kTln2) [1] gives a lower bound of energy that must be dissipated to destroy one bit of information in a computation. A reversible calculation does not destroy bits.

[1] https://en.wikipedia.org/wiki/Landauer%27s_principle

Re: Nilang.jl – A Reversible Julia DSL

#10
post #2

Incredible. Given a (one-to-one) Julia function `f`, this package generates `~f`, the inverse of f. Clever use of automatic differentiation. Paper: https://arxiv.org/abs/2003.04617

Is this in essence the same as the relation between a differential equation and it’s adjoint equation, and how one could use the asking method to perform back propagation? (Eg: ref. Neural ODEs)
Post reply on HN