Skip to content

Add MOInputHeterotopic type & helpers #393

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

thomasgudjonwright
Copy link
Member

Summary

This closes #358 which proposes making a MOInputsHeterotopic type and some supporting infrastructure. It is meant for multi-ouput GPs where not all data is observed at every output.

@codecov
Copy link

codecov bot commented Oct 27, 2021

Codecov Report

Merging #393 (24bbeb3) into master (ab30149) will decrease coverage by 0.08%.
The diff coverage is 77.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #393      +/-   ##
==========================================
- Coverage   89.23%   89.14%   -0.09%     
==========================================
  Files          52       52              
  Lines        1198     1207       +9     
==========================================
+ Hits         1069     1076       +7     
- Misses        129      131       +2     
Impacted Files Coverage Δ
src/KernelFunctions.jl 100.00% <ø> (ø)
src/mokernels/moinput.jl 95.12% <77.77%> (-4.88%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ab30149...24bbeb3. Read the comment docs.

@st-- st-- changed the title Tgw/heterotopic Add MOInputsHeterotopic type & helpers Oct 28, 2021
@st-- st-- changed the title Add MOInputsHeterotopic type & helpers Add MOInputHeterotopic type & helpers Oct 28, 2021
@st--
Copy link
Member

st-- commented Oct 28, 2021

What's the advantage of a separate type MOInputHeterotopic{T} over a Vector{Tuple{T,Int}} & zip(x, output_indices)?

@st--
Copy link
Member

st-- commented Oct 28, 2021

Actually I just re-discovered prepare_heterotopic_multi_output_data from #353 :)

To clarify what I'm trying to understand: what are the use-cases for a new concrete type? What things could we do (at all, or rather more easily) with it that would not work (or at least not so easily) with only Vector{Tuple{T,Int}} (and perhaps a type alias)?

I'm a bit wary of adding code without concrete use-cases: to accept an increase in the maintenance burden, it'd be good to see the benefits that it brings! So I think it'd be good to demonstrate them, ideally in an example notebook...

@thomasgudjonwright
Copy link
Member Author

thomasgudjonwright commented Nov 4, 2021

Actually I just re-discovered prepare_heterotopic_multi_output_data from #353 :)

To clarify what I'm trying to understand: what are the use-cases for a new concrete type? What things could we do (at all, or rather more easily) with it that would not work (or at least not so easily) with only Vector{Tuple{T,Int}} (and perhaps a type alias)?

I'm a bit wary of adding code without concrete use-cases: to accept an increase in the maintenance burden, it'd be good to see the benefits that it brings! So I think it'd be good to demonstrate them, ideally in an example notebook...

Hmm this is a good point I hadn't really considered. I suppose most, if not all of this can be done with simply a Vector{Tuple{T,Int}}. Maybe this is unnecessary.

Are we able to create helper methods for an alias? Having support functions explicity for heterotopic data is the only potential benefit I see beyond just having a clear object named for every type of MO-input we can imagine. @willtebbutt do you have any thoughts on this?

@willtebbutt
Copy link
Member

To be honest, in the absence of a really clear example, I'm not sure what this gets us over just using a Vector{Tuple}, so my inclination would be to stick with that for now.

I could imagine that the internal representation you've got here could be beneficial in some operations (I don't have any good examples though), but in such cases I'd be inclined to just use a StructArray.

@devmotion
Copy link
Member

Maybe we could mark the PR with a (new) label "pending clear need" for now? 🙂

@thomasgudjonwright thomasgudjonwright added do not merge pending clear need Shelfed until a use case is identified labels Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge pending clear need Shelfed until a use case is identified
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create MOInputHeterotopic type
4 participants