Skip to content

autodiff for matrix add and subtract #1787

Open

Description

@bob-carpenter

Description

There are lots of functions that don't have reverse mode specializations.

Matrix operations

All of these would be very useful, espcially the basic arithmetic of the first five and inverse_spd because it's so important.

  • add
  • subtract
  • minus
  • elt_multiply
  • elt_divide
  • diag_post_multiply
  • diag_pre_multiply
  • quad_form_diag
  • chol2inv
  • `inverse_spd

All of the constraints would be good to specialize. These get used everywhere (the least important are corr_constrain and cov_matrix_constrain---the cholesky forms are more important for our recommended usages).

  • lb_constrain
  • ub_constrain
  • lub_constrain
  • corr_constrain
  • cov_matrix_constrain
  • cholesky_factor_constrain
  • cholesky_corr_constrain
  • offset_multiplier_constrain

Then there are some reductions:

  • mean
  • sd
  • variance

There are probably more.

Feel free to solve one or more of these in a PR.

Current Version:

v3.1.0

Activity

  1. betanalpha commented on Mar 21, 2020

    @betanalpha
    Contributor
  2. wds15 commented on Mar 21, 2020

    @wds15
    Contributor

    Sounds like there is a lot of performance on the table to grab here! Looking forward to those benchmarks.

  3. bob-carpenter commented on Mar 23, 2020

    @bob-carpenter
    MemberAuthor

    Definitely direct adjoint-Jacobian implementations are the way to go to avoid all the virtual function calls and collapse the autodiff graph.

  4. dpsimpson commented on Mar 27, 2020

    @dpsimpson
    Contributor

    If no one minds, I'll have a shot at some of these over the weekend.

  5. bob-carpenter commented on Mar 27, 2020

    @bob-carpenter
    MemberAuthor

    @dpsimpson: All yours.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions