Currently, the check for verifying whether or not a target is normalised is too strict as it checks for Interval(0,1) exactly. This causes issues when using Transformations that do not exactly calculate Interval(0,1) but something close to it like Interval(0,0.999999999) like in the following example:
from baybe.targets import NumericalTarget
t_clamp_bug = NumericalTarget.match_bell(name = "Bug", match_value=5, sigma=0.1).clamp(0, 0.606531).normalize()
print(t_clamp_bug.get_image((-100, 100)))
> Interval(lower=0.0, upper=0.9999999999999999)
To fix this, we need to use a tolerance or a fuzzy match when checking whether or not a target is normalised.
Currently, the check for verifying whether or not a target is normalised is too strict as it checks for
Interval(0,1)exactly. This causes issues when usingTransformations that do not exactly calculateInterval(0,1)but something close to it likeInterval(0,0.999999999)like in the following example:> Interval(lower=0.0, upper=0.9999999999999999)To fix this, we need to use a tolerance or a fuzzy match when checking whether or not a target is normalised.