Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before, the standard deviation was applied on the mean difference between current and last weights (scalar), which resulted in the evolution parameter being zero already in the first iteration. Hence, the deBroeg algorithm only runs once when using .autodiff(). Removing the standard deviation fixes the issue.
I also tested between using the maximum difference and the mean difference of current and last weight for a few example dates. In the dates I've tested, the results are identical, but the mean difference method uses less iterations. This is why I have settled for the mean difference approach for now.
Furthermore, I've implemented two additional lines related to any mask that is applied to a 'Fluxes' instance by using the 'mask_stars' function. Specifically, i identify stars with a std of zero in the first iteration (as 'mask_stars' sets masked stars to be -1 for all times) and then apply the mask after all iterations to the resulting weights. I did this, as before it would only set the weights to zero for these masked stars in the first iteration, but as soon as the weights are defined by the binned white noise of the lightcurve (from the second iteration onwards), the masked stars get non-zero values, which defies the purpose of masking.