-
Notifications
You must be signed in to change notification settings - Fork 60
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
Singularity matrix #13
Comments
Hi, What do you mean by "includes max and min and some conversions"? Also, does it happen only for this specific function? Have you tried with other functions? |
@paulknysh, It happen on that function. I tried your example, it's working. Also I tried to simplify my function, and it worked, but I need to compute really heavy function.... |
I recommend to simplify the function as much as you can, make sure that method works well for it, and then start adding complexity step by step and see at which step it starts failing. Also if you can figure out which part of the code fails, that will be useful. |
Hi, @paulknysh ! I had have some initial point, close to maximum of function, and i have done the next thing: my function parameters now not the same that parameters I want, my parameters are coefficients, that I use to multiply for initial point and, it seems, it's good for me. Thank you, I think this issue can be closed. But can you please explain, why do you not processing cases, when that matrix is singular or close to singular? |
Sorry, I missed your question about simplify the function. Yes, I tried. I can say, that it was my mistake in first situation, because i tried to find the minimum instead of maximum. But in second situation, I discovered that if m is big (400, for example) that error is going on too. |
I just looked again at your error log, it looks like error occurs at line 212 (solving linear system for RBF fit). That is a built-in numpy solver, so I don't know how it works and what's wrong. I found that people had similar issues in the past: https://stackoverflow.com/questions/13795682/numpy-error-singular-matrix They suggest using linalg.lstsq instead of linalg.solve. Feel free to try that. |
@paulknysh |
@paulknysh |
As for n and m, there are no specific rules. n regulates initial function evaluations (global search), m - subsequent evaluations (local search). Typically, choosing n = m works reasonably well. Here is the description of what numpy.lstsq does: I'm probably going to add this into the code as a backup solver. This shouldn't affect optimization algorithm. |
Added np.linalg.lstsq as a backup solver. Feel free to test. |
Hi!
I have a hard function, that includes
max
andmin
and some conversions. I am getting the following error after few steps:The text was updated successfully, but these errors were encountered: