Conversation
|
Nice! - will take a look tonight Edit: I will let others take a look first. |
There was a problem hiding this comment.
Thanks a lot for the PR. I have a problem with the functional form that this prior has, I think it has redundant parameters for a polynomial which can induce inestabilities in the fit.
If people have already worked with a functional form like this and it works most of the time then maybe we could merge it but I would be against it.
It would also be interesting to hear the opinion of @jacopoventurin who I think has worked with similar functional forms before.
mlcg/nn/prior.py
Outdated
| @staticmethod | ||
| def _quartic_model(x, a, b, c, d, xa, xb, xc): | ||
| return a * (x - xa) ** 2 + b * (x - xb) ** 3 + c * (x - xc) ** 4 + d | ||
|
|
There was a problem hiding this comment.
A deg 4 polynomial p(x) is uniquely caracterized by 5 numbers: a_0, .. a_4 such that p(x) = sum_{k=0}^4 a_k * x^k. Your degree 4 polynomial uses 7 parameters in order to keep this shape of p(x) = sum_{k=2}^4 b_k *(x_0^{(k)} x)^k. Isn't the fit then ill posed?
At some point I tried to use an expression similar to what you have now and found it problematic because of this redundancy of parameters.
mlcg/nn/prior.py
Outdated
| dG_nz: torch.Tensor, | ||
| **kwargs, | ||
| ): | ||
| """ |
There was a problem hiding this comment.
You need to make a PR also to mlcg-tk because we need to call also the fitting function from there.
|
So, after some changes and some IRL discussion, we agreed that, even though mathematically ill posed, your functional form was fittable by the use of bound. However, we saw that the same results could be achieved using also a polynomial function properly bounded and we agreed on moving forward with a simpler polynomial. In my most recent push I replaced the Quartic class with the Polynomial and QuarticAngles class, which implement the mentioned polynomial. PLease feel free to test them. I've also opened a PR in mlcg-tk to also support this prior so that you can train a model from scratch and fully test the performance. |
|
After some tests, I can obtain some BBA models that have a reasonable behaviour, I am not sure that the models are much better than previous models with the harmonic prior, but I think this is enough proof to show that this is not a significant downgrade. Furthermore, I see more stable simulations using this priors than with a harmonic angle. Given this, I consider that we are ready to merge this |
|
LGTM |

PR Checklist
Describe your changes here:
Added a quartic prior, particularly useful to deal with CA angles resolution