Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何让 optuna 建议从此列表中的浮点数值:
[1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 1e-1, 1.0]
我正在使用这个 Python 代码片段:
trial.suggest_float("lambda", 1e-6, 1.0, log=True)
它正确地建议了 1e-6 和 1.0 之间的值,但它建议了该范围内的其他值,而不仅仅是上面列表中明确的值。我究竟做错了什么?
要从列表中选择,请使用Suggest_categorical。
trial.suggest_categorical("lambda", [1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 1e-1, 1.0])