round to decimals low and high

This commit is contained in:
viotemp1
2025-05-08 05:49:34 +03:00
parent 5d2f5ec12f
commit 47e1d209db

View File

@@ -1,5 +1,3 @@
from math import log10
from optuna.distributions import FloatDistribution
@@ -22,7 +20,7 @@ class SKDecimal(FloatDistribution):
self.name = name
super().__init__(
low=round(low, int(log10(1 / self.step))) if self.step < 1 else low,
high=round(high, int(log10(1 / self.step))) if self.step < 1 else high,
low=round(low, decimals) if decimals else low,
high=round(high, decimals) if decimals else high,
step=self.step,
)