2025/02/25

Newest at the top

2025-02-25 10:24:47 +0100 <tomsmeding> nothing, it seems, semantically?
2025-02-25 10:24:29 +0100 <tomsmeding> *supposed
2025-02-25 10:24:27 +0100 <tomsmeding> I'm not familiar enough with the 'ad' API to figure out what that 'AD' type is suppose to do
2025-02-25 10:22:59 +0100dsrt^(~dsrt@108.192.66.114) (Ping timeout: 260 seconds)
2025-02-25 10:22:50 +0100 <tomsmeding> the fact that that package's name is so short is really inconvenient. :P
2025-02-25 10:22:36 +0100tomsmedingopens the 'ad' docs
2025-02-25 10:22:30 +0100off^(~off@108.192.66.114) (Ping timeout: 268 seconds)
2025-02-25 10:22:19 +0100 <Athas> It's 'diffF' on a function that uses 'grad'.
2025-02-25 10:21:55 +0100 <Athas> Operationally yes. I don't know what the type of that looks like. I was referring to the surface syntax.
2025-02-25 10:21:13 +0100 <tomsmeding> i.e. doing reverse mode, but secretly the scalars are dual numbers?
2025-02-25 10:21:08 +0100califax(~califax@user/califx) califx
2025-02-25 10:21:00 +0100 <tomsmeding> wouldn't that be Reverse s (Forward Double) in 'ad'?
2025-02-25 10:20:49 +0100califax(~califax@user/califx) (Remote host closed the connection)
2025-02-25 10:20:40 +0100 <Athas> It Just Works in 'ad'.
2025-02-25 10:20:27 +0100 <Athas> jvp (\ ... vjp ...), but with the weird 'ad' names instead.
2025-02-25 10:20:17 +0100 <tomsmeding> and I think you may be right that IO is overkill here!
2025-02-25 10:19:57 +0100Smiles(uid551636@id-551636.lymington.irccloud.com) Smiles
2025-02-25 10:19:49 +0100 <tomsmeding> how would that look in 'ad'?
2025-02-25 10:19:31 +0100 <Athas> But this cannot possibly do reverse-then-forward, right?
2025-02-25 10:19:14 +0100 <tomsmeding> surely they could be
2025-02-25 10:19:09 +0100 <Athas> I guess they could be.
2025-02-25 10:19:01 +0100 <Athas> Are dual numbers Storable?
2025-02-25 10:18:52 +0100 <Athas> This looks compelling, but why unsafePerformIO directly? Can this not be expressed with ST?
2025-02-25 10:18:43 +0100AlexZenon(~alzenon@178.34.162.44)
2025-02-25 10:18:18 +0100 <tomsmeding> it doesn't even assume that 'a' is Double, so you should be able to instantiate 'a' with a standard forward-mode dual number
2025-02-25 10:17:49 +0100 <Athas> Yes, I think it's fine for all of my uses, but honestly just 'VS.Vector a' would work as well.
2025-02-25 10:17:38 +0100 <tomsmeding> Or a boxed vector of vectors!
2025-02-25 10:17:25 +0100 <tomsmeding> it just means that you can pass in a single vector if you want, but also a list of vectors.
2025-02-25 10:17:02 +0100 <Athas> This looks compelling. Using 'f (VS.Vector a)' instead of just 'a' is make it easier to have some efficient representation without imposing constraints on 'f'?
2025-02-25 10:15:48 +0100 <tomsmeding> also that
2025-02-25 10:15:40 +0100 <Athas> Yes, that can be fixed at a higher level.
2025-02-25 10:15:12 +0100 <tomsmeding> but that's rather non-fundamental
2025-02-25 10:15:04 +0100 <tomsmeding> arrays are single-dimensional only
2025-02-25 10:14:57 +0100 <tomsmeding> full disclosure: I've been hacking on something like this; the API currently looks like this: gradient' from here ( https://git.tomsmeding.com/ad-dual/tree/src/Numeric/ADDual/Array/Internal.hs ), where 'VDual s Double' implements the classes from here ( https://git.tomsmeding.com/ad-dual/tree/src/Numeric/ADDual/VectorOps.hs )
2025-02-25 10:13:43 +0100 <Athas> When you're talking about the Jacobian matrix, you're already in a sense flattening all of the scalars to form each axis.
2025-02-25 10:13:01 +0100 <tomsmeding> I'm not thinking about functional vector fields :p
2025-02-25 10:12:52 +0100AlexZenon(~alzenon@178.34.162.44) (Ping timeout: 272 seconds)
2025-02-25 10:12:43 +0100 <Athas> I'd much prefer a Haskell AD library that can efficiently handle boring classic numerical problems, even if fancy weird things, like functional vector fields, cannot be handled.
2025-02-25 10:12:20 +0100 <Athas> These libraries ultimately expect the input to be a sequence of scalars. In Haskell, you could do fancier things (like arrays of functions!), but I'm not sure that is so useful.
2025-02-25 10:12:01 +0100 <tomsmeding> well f (Vector Double) would be rather easy to support, for a Traversable f
2025-02-25 10:11:35 +0100 <Athas> You just pretend the arrays are concatenated. It's easy.
2025-02-25 10:11:28 +0100 <tomsmeding> interesting
2025-02-25 10:11:22 +0100 <Athas> It's common in C++ AD libraries yes, although they sometimes put some polish on top to make it seem like that's not how it works.
2025-02-25 10:11:18 +0100 <tomsmeding> which works for scalars, but if you have array support, then it's suddenly inadequate
2025-02-25 10:11:05 +0100 <tomsmeding> exactly
2025-02-25 10:10:58 +0100 <Athas> But I don't understand - if you require that the input is some 'f t' where 'f' is Traversable, isn't that essentially going to be a sequence of 't's with some shape on top?
2025-02-25 10:10:57 +0100 <tomsmeding> that feels a bit much, to me
2025-02-25 10:10:50 +0100 <tomsmeding> do other AD libraries really do that?
2025-02-25 10:10:40 +0100 <Athas> Not the list, just 'Vector a'.
2025-02-25 10:10:23 +0100 <tomsmeding> what do you mean with a monomorphic sequence of scalars? [Vector a]?