MeasureTransport / MeasureTransport/MParT

Add slice and condition functions to ConditionalMapBase

Open
#106 0 comments 0 reactions 1 assignee View on GitHub

@mparno is already working on this.

Since Jul 15, 2022.

enhancement
Dominant language
C++
Stars
18
Forks
5
PR merge metrics
No merged PRs in 30d

Description

In the ConditionalMapBase hierarchy, we should add functions that make it trivial to extract components of the map. We can mimic the functions in eigen and provide:

  • head(unsigned int n) Given a map T_{1:N}(x_{1:M}), this function will return the first n components: T_{1:n}(x_{1:M})
  • tail(unsigned int n) Returns T_{N-n:N}(x_{1:M})
  • segment(unsigned int startInd, unsigned int n) Returns T_{i:i+n}(x_{1:M})

In addition to these slice functions, we can add a function to define a conditional map by fixing the first n inputs:

  • given(Kokkos::View<double*> const& xstart) returns a map T_{1:N}(x_{n:M}) where the first x_{1:n} block of the input is fixed to the input argument xstart. Note that this function could be implemented in at least two ways: (1) We can keep the original map object the same, but add another class that concatenates xstart with a new values of x_{n:M} before calling the original map or (2) we could define the conditional map by updating the coefficients of the original map to account for the known value of xstart. Option (1) is more general and will work for any implementation of ConditionalMapBase while option (2) will result in more efficient map evaluations, but requires a more intrusive implementation that may be restricted to the MonotoneComponent class.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.