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

Example/documentation for parametric domain of integration? #186

Open
mawright opened this issue Sep 28, 2023 · 9 comments
Open

Example/documentation for parametric domain of integration? #186

mawright opened this issue Sep 28, 2023 · 9 comments

Comments

@mawright
Copy link

Hi,

I found issue #170 asking about the case where both the integrand and the domain of integration are functions of parameters, and it looks like @ilan-gold implemented this feature in pull request #173. I'd like to use this feature and wanted to ask if there are any examples or documentation showing how to use it.

Thanks!

@mawright mawright changed the title Example/documentation for parametric domain of integration Example/documentation for parametric domain of integration> Sep 28, 2023
@mawright mawright changed the title Example/documentation for parametric domain of integration> Example/documentation for parametric domain of integration? Sep 28, 2023
@gomezzz
Copy link
Collaborator

gomezzz commented Sep 28, 2023

Hey @mawright !

Thanks for your interest! This should be documented here in the readthedocs, I think? :)

In case it is what you are looking for, feel free to suggest any potential changes that can help make it easier to find. 🙏

Edit: Ah, actually that is only for the same domain, I think 🤔 Maybe @ilan-gold can chime in if it's possible?

@ilan-gold
Copy link
Collaborator

Hi @mawright - to clarify, what I did is make it so that you could implement this by tweaking a few things in the API. There's no feature at the moment for it. You would have to override a few functions to handle however you want to handle the new domain.

@ilan-gold
Copy link
Collaborator

I can perhaps write something up explaining which methods to override - how does that sound @gomezzz ? Perhaps an example if it's not too crazy?

@gomezzz
Copy link
Collaborator

gomezzz commented Sep 28, 2023

I can perhaps write something up explaining which methods to override - how does that sound @gomezzz ? Perhaps an example if it's not too crazy?

That would be fantastic! :)

@mawright
Copy link
Author

Thanks! Looking forward to it!

@mawright
Copy link
Author

I wrote something that works for my problem. It's here: https://github.com/mawright/torchstable/blob/main/torchstable/integrator.py.

@ilan-gold
Copy link
Collaborator

@mawright I am sorry for not doing this yet. I'm finishing my thesis at the moment so have been a bit busy. You got it right, though, it seems. My code looks quite similar

@mawright
Copy link
Author

mawright commented Oct 13, 2023

No problem. One thing I was thinking is that it might be easier to work with batch integration if there was an additional batch dimension. The hacked-together thing I wrote breaks a lot of the code's assumptions as to the meaning of the tensor dimensions, e.g. that the polynomial roots and the number of rows of integration_domain have the same dimension, the splitting up of the N gridpoints over a multidimensional space, etc. Not sure how much work that would be for you though.

@gomezzz
Copy link
Collaborator

gomezzz commented Oct 18, 2023

No problem. One thing I was thinking is that it might be easier to work with batch integration if there was an additional batch dimension. The hacked-together thing I wrote breaks a lot of the code's assumptions as to the meaning of the tensor dimensions, e.g. that the polynomial roots and the number of rows of integration_domain have the same dimension, the splitting up of the N gridpoints over a multidimensional space, etc. Not sure how much work that would be for you though.

Alternatively, to make the feature more accessible, maybe as a start you could add your example and a few explanatory words in the docs? This might already help as this feature interests many, I think? :)

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

No branches or pull requests

3 participants