贴个官方文档:https://optuna.readthedocs.io/en/stable/tutorial/index.html 先定义目标函数,然后创建study,创建时可以选择优化算法,然后优化,将目标函数和迭代次数输入优化器。