-
Notifications
You must be signed in to change notification settings - Fork 7
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
too small a value error in "min(exp(B*alpha))" while running ISMA fit #89
Comments
This is likely because you have too many posynomial terms. What is the dimension of your data, and the parameters of your fit? Also, you can try disabling the error in the source code and see what you get. |
(you can find the directory of gpfit by calling |
Oh yes i did. Facing same issues |
I'm trying to replicate now. I am currently using gpfit with no issues on similar examples, so this is odd. |
Alright, I replicated with the following MWE (please provide this for future issues): import numpy as np
from gpfit.fit import fit
np.random.seed(314)
x = np.arange(-2,2,0.01)
a = -6*x + 6
b = 1/2*x
c = 1/5*x**5 + 1/2*x
y = np.max([a,b,c], axis=0)
K=3
cstrt, rms = fit(x, y, K, "ISMA") The issues can be caused by random seed. I put 314 and issues were fixed. Please confirm that this works for you. |
Fyi, the occasional infs in the residual give the warnings. I didn't write the algorithm so I don't know exactly how the residual becomes inf and how the method navigates these solutions, but I know it involves a trust region reduction for the next iteration. But it is clear that as the solution is further refined, the singularity of the coefficients get worse. At maxtime of around 0.25-0.3s you actually recover the results from the paper. This is the best I can do to help. |
Actually i did do the same thing just now. Printed out the residuals as a sanity check. I got similar results like you posted. It is strange that ISMA works perfectly well for a log-space transformed input and gives out a perfect GP compatible fit function. However, it is just for this problem, the residuals go wild. Thanks a lot for helping out though. |
No problem! I will keep this issue open since this is undesired behavior, and one that should probably be addressed. I am 95% certain it is because of the kink in this specific function. |
I am trying the toy fitting problem (Figure 3) from the paper "Data fitting with geometric programming compatible function". I did manage to get the 'MA' and 'SMA' fit, however while trying the 'ISMA' fit i am constantly encountering the "Fitted constraint with too small values" error in the parameters value after running levenberg-marquardt algorithm. I did check the implementation a lot of times and i ended up getting the same error either in the parameter B( with too small value) or in the parameter A (with too large value). Is there a work around to this problem? Please note that I tried initializing the parameters using both 'MA' and 'SMA'. The alpha_init value was set to 1. And the lambda to be 0.2.
The text was updated successfully, but these errors were encountered: