Skip to content

Test rrules with finite differences #118

@gdalle

Description

@gdalle

Or ChainRulesTestUtils, but beware to keep the same seed.

Problem: our real-life function is an average over a finite number of samples, so its finite-differences (and true) gradient is almost zero. What we define as its gradient through the rrule is actually the Monte-Carlo approximation of the expectation (over an infinite number of samples).
Take a large enough finite difference step or enough samples to mitigate piecewise-constantness.

Our functions are not smooth, but for FYL + SPO + SSVM for instance we return a subgradient. Can we test that property in the convex case?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions