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

Increase tolerance of assert check for solve accuracy, or add option to allow failure. #406

Closed
vlandau opened this issue Jan 26, 2024 · 4 comments · Fixed by #407
Closed

Comments

@vlandau
Copy link
Member

vlandau commented Jan 26, 2024

Several Omnsicape users are running into issues with AssertionErrors:

AssertionError: norm(G * v .- curr) / norm(curr) < 1.0e-6

I'm wondering if we can either increase the error tolerance here, make it relative instead of absolute, or add an option to allow failure of this check. My understanding is that the tolerance of 1e-6 was chosen somewhat arbitrarily? When running 100s or 1000s of moving windows, there is more likely to be an edge case where this check fails. If I could tell Circuitscape to allow this check to fail and instead log a warning about potential innacuracies (and maybe their magnitude relative to current density predictions?) around that one moving window, I think that would alleviate a big headache for many Omniscape users. Alternatively, if we can make this tolerance larger, or allow it to be relative, we may end up seeing this issue pop up a lot less, while still enforcing some degree of accuracy in the solutions.

cc @ranjanan @ViralBShah

@ViralBShah
Copy link
Member

Yes, update the tolerance and also make relative.

@vlandau
Copy link
Member Author

vlandau commented Jan 27, 2024

Okay great. I can look into this this weekend. Any tips on how to adjust the tolerance based on the matrix norm? Happy to just put in a PR if this is straightforward enough.

@ViralBShah
Copy link
Member

I suggest just reduce the value to 1e-5 or 1e-4 for now.

@ViralBShah
Copy link
Member

ViralBShah commented Feb 2, 2024

I've submitted the updated package to the registry. JuliaRegistries/General#100079

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants