-
Notifications
You must be signed in to change notification settings - Fork 5
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
refactor!: create ParametrizedFunction interface #353
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@spflueger as discussed, tensorwaves/src/tensorwaves/interface.py Line 32 in 49eae48
This is probably fine with interfaces, but another option would be to give |
49eae48
to
195c8e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good & good job. Just two questions about some design choices
195c8e1
to
b103613
Compare
Short summary of offline discussion with @spflueger :
|
82ce0d4
to
bc96b6e
Compare
bc96b6e
to
b9bd244
Compare
The existing
Function
interface has too many responsibilities: it (1) converts aDataSample
to an array or tensor and (2) distinguishes parameter variables from domain variables. This worked fine so far, becauseFunction
was only used when optimizing, where you need to tweak those parameters. In #345 though, we need to aFunction
that only does (1), for the conversion of oneDataSample
(four-momenta) to anotherDataSample
(kinematic variables) with different back-ends.This PR creates a new
ParametrizedFunction
interface that does (1) and (2) and a 'bare'Function
interface that does only (1). The input and output types of theFunction
interface are generic, so that it can be used in different types of function-like interfaces.Related changes:
LambdifiedFunction
toParametrizedBackendFunction
.DataTransformer.transform()
has become a__call__
andDataTransformer
derives fromFunction
.Estimator
also derives fromFunction
: it computes an estimator value for a set of parameters.