Discrete optimzation in python

时间秒杀一切 提交于 2019-12-04 03:08:04

I've checked scipy.optimize.anneal, and I can't see a way to use discrete values. The way to implement it yourself, is to create a custom "move" function, but the way you have to specify the schedule (by a string) prevents you from doing so.

I think it is a big mistake, if you could just pass a custom schedule class as the parameter, you could customize it for using discrete variables and many more things.

The solution I found is to use this other implementation instead: https://github.com/perrygeo/python-simulated-annealing

Because you have to provide the function which modifies the state, you have control on what values it can have, or if they are discrete or continuous.

Hope it helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!