mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
add back INITIAL_POINTS (default 30) for Samplers which support this
This commit is contained in:
@@ -45,6 +45,7 @@ from freqtrade.util.dry_run_wallet import get_dry_run_wallet
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
INITIAL_POINTS = 30
|
||||||
|
|
||||||
MAX_LOSS = 100000 # just a big enough number to be bad result in loss optimization
|
MAX_LOSS = 100000 # just a big enough number to be bad result in loss optimization
|
||||||
|
|
||||||
@@ -425,6 +426,15 @@ class HyperOptimizer:
|
|||||||
raise OperationalException(f"Optuna Sampler {o_sampler} not supported.")
|
raise OperationalException(f"Optuna Sampler {o_sampler} not supported.")
|
||||||
with warnings.catch_warnings():
|
with warnings.catch_warnings():
|
||||||
warnings.filterwarnings(action="ignore", category=ExperimentalWarning)
|
warnings.filterwarnings(action="ignore", category=ExperimentalWarning)
|
||||||
|
if o_sampler in ["NSGAIIISampler", "NSGAIISampler"]:
|
||||||
|
sampler = optuna_samplers_dict[o_sampler](
|
||||||
|
seed=random_state, population_size=INITIAL_POINTS
|
||||||
|
)
|
||||||
|
elif o_sampler in ["GPSampler", "TPESampler", "CmaEsSampler"]:
|
||||||
|
sampler = optuna_samplers_dict[o_sampler](
|
||||||
|
seed=random_state, n_startup_trials=INITIAL_POINTS
|
||||||
|
)
|
||||||
|
else:
|
||||||
sampler = optuna_samplers_dict[o_sampler](seed=random_state)
|
sampler = optuna_samplers_dict[o_sampler](seed=random_state)
|
||||||
else:
|
else:
|
||||||
sampler = o_sampler
|
sampler = o_sampler
|
||||||
|
|||||||
Reference in New Issue
Block a user