Skip to content

Using logfloat with ad #4

Description

@adscib

I was wondering whether it would be possible to use logfloat with the ad library. In machine learning we commonly need to compute a gradient of the log-likelihood. I don't imagine this is currently feasible since I can't see any way to differentiate through logarithms in logFloat etc.

I can think of two potential solutions - either to abstract all the logfloat functions using suitable typeclasses and then write instances of those for ad types or to abstract the LogFloat over the underlying numeric type. I don't know how feasible is the former, but I suspect the latter could be done in principle although in practice may be problematic since logfloat performs some low-level operations specific to Double.

In any case, do you think there's some way to make the two libraries work together? And if so how much effort would it take?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions