desy-ml / cheetah

Fast and differentiable particle accelerator optics simulation for reinforcement learning and optimisation applications.
https://cheetah-accelerator.readthedocs.io
GNU General Public License v3.0
33 stars 13 forks source link

Prevent numerical errors, Infs and NaNs #84

Open jank324 opened 1 year ago

jank324 commented 1 year ago

@cr-xu ... I'm not sure if this is a change that we should actually merge. I realised, that in my project, I often end up in unreasonable value ranges (when doing random actions that I shouldn't actually be doing). The issues I fixed only occur in those unreasonable ranges. So, the question is whether we should merge this PR, or say that these are such stupid cases, that we shouldn't clutter up our code with fixes for them. Let me know what you think.