Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compact monotone component #423

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

dannys4
Copy link
Contributor

@dannys4 dannys4 commented Jun 13, 2024

Similar to how Sven's work parameterizes the map, and using my favorite compile-time tooling, this is a ludicrous addition to MonotoneComponent that changes the parameterization to
$$T(\mathbf{x},y) = \frac{\int\limits_0^y g(\partial_2 f(\mathbf{x},t))\ dt}{\int\limits_0^1 g(\partial_2 f(\mathbf{x},t))\ dt},$$
where $g$ is a rectifier, $f$ is a MultivariateExpansionWorker. Points of note:

  • Since this is virtually the same machinery as MonotoneComponent, I just added it as a compile-time feature there. I will (somewhat baselessly?) assert that there's no runtime overhead for "traditional" MonotoneComponent objects (at least, compiled with RELEASE flags).
  • As a matter of logistics: note that this doesn't have the $f(\mathbf{x},0)$ in the "traditional" map, since that could escape the hypercube. I wracked my brain trying to allow for this flexibility, but couldn't figure it out.
  • For some reason, I see that mixed coefficient jacobians are zero for multi-indices of the form $(k,0)$ and $(k,1)$. I understand the former, but not sure why on the latter? I guess since there's a second derivative, the chain rule ends up eliminating a term, but I'm not sure.
  • Since this is compile time, I added the ability to use the usual (non-linearized) bases with the "compactified" basis. I have no idea if this is useful or if I just added a bunch of compile-time cruft; I'm flexible if this should be removed.
  • The major overhead added here is the fact that the integral needs to be evaluated twice, and now some derivatives need to get quotient-ruled. I suspect the overhead will be most visible in, e.g., LogDeterminantCoeffGrad, which will become
    $$\nabla_w\log \partial_y T(x,y;w) = \frac{\nabla_w g(\partial_2 f(\mathbf{x},y,\mathbf{w}))}{g(\partial_2 f(\mathbf{x},y,\mathbf{w})} - \frac{\nabla_w \int_0^1 g(\partial_2 f(\mathbf{x},t,\mathbf{w})\ dt}{\int_0^1 g(\partial_2 f(\mathbf{x},t,\mathbf{w})\ dt}$$
    note that this now has integrals, where it previously did not.
  • By construction, $T:\ [0,1]^d\times[0,1]\to[0,1]$. As such, I also added a few new bases for the future.
  • The only one available via CreateComponent at this point is ShiftedLegendre (which corresponds to BasisTypes::Legendre), which is orthogonal on $U[0,1]$ (note that this is shifted and thus gives a slightly different TTRR than the traditional Legendre).
  • I also added SineBasis for the time being, which represents $p_k(t) = sin(2\pi k t)$ but is calculated similar to a TTRR. This can be added, but the current PR is more of a proof of concept.
  • While working through the different iterations of this parameterization, I ended up slightly changing the nomenclature for MapFactory's REGISTER_MONO_COMP to work better for future perhaps heterogeneous map types
  • This doesn't have bindings. Since we have a developer's main branch, I'm going to make separate PRs for that kind of stuff. I'm also open to merging this into a completely separate branch.

@dannys4 dannys4 added this to the v3.1 milestone Jun 13, 2024
@dannys4 dannys4 requested a review from mparno June 13, 2024 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant