I'm creating too much throw away code for interfacing with the scipy optimize package in a user friendly way. (See code below for example of interruptible optimization that keeps last optimization value after a KeyBoard interrupt)
def monitoring_callback(x):
global callback_dict
callback_dict['cached_results'] = x
callback_dict['counter'] = callback_dict['counter'] +1
try:
fit_results= optimize.minimize(get_mean_squared_error,
my_fit_params,method="CG",
callback=monitoring_callback)
my_fit_params = fit_results
except KeyboardInterrupt:
my_fit_params = callback_dict['cached_results']
Is there an existing package that does this sort of thing? (Also, if it implemented graphics like here, http://louistiao.me/notes/visualizing-and-animating-optimization-algorithms-with-matplotlib/
that would be really useful.)