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

bind: chaining binds together #131

Open
fjebaker opened this issue Oct 3, 2024 · 1 comment
Open

bind: chaining binds together #131

fjebaker opened this issue Oct 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@fjebaker
Copy link
Owner

fjebaker commented Oct 3, 2024

Suppose we had two models, A and B. We bound A.K_1 to B.K_2 but then bound A.K_1 to A.K_2. We now will get an index error when we try to get the parameters for model B because the parameter array of A has one parameter fewer.

Possible solution:

  • during bind!, check if we are binding a parameter that is already due to be bound. If so, append new bindings to them.
@fjebaker fjebaker added the bug Something isn't working label Oct 3, 2024
@phajy
Copy link
Contributor

phajy commented Oct 25, 2024

Not strictly a chaining problem but perhaps a related bug: I noticed that when, e.g., the second model was bound to the first model so they should be identical the model parameters were, in fact, different.

julia> result[1]
┌ FittingResultSlice:
│   Model: CompositeModel[XS_Jet + XS_Optxagnf]
│   . u     : [3.0, 10.0, 0.20000, 10.0, 2.1000, 0.00010000, -1.0000, 3.0, 13.0, 0.10000, 1275.0, 2.6000, 43.300, 10.990, 300.0, 3000.0, 0.98000, 2.7000]
│   . σᵤ    : [nothing]
│   . χ²    : 396.92 
└ 

julia> result[2]
┌ FittingResultSlice:
│   Model: CompositeModel[XS_Jet + XS_Optxagnf]
│   . u     : [3.0, 0.20000, 10.0, 2.1000, 0.00010000, -1.0000, -1.0000, 3.0, 13.0, 0.10000, 1275.0, 2.6000, 43.300, 10.990, 300.0, 3000.0, 0.98000, 2.7000]
│   . σᵤ    : [nothing]
│   . χ²    : NaN 
└ 

I've put this issue here as a placeholder while I investigate further (I still need to confirm it is actually a bug and not something I've done!) I will post an update here when I've dug a bit deeper...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants