%load_ext autoreload
%autoreload 2
from cbx.objectives import snowflake
from cbx.dynamics import PolarCBO
from cbx.plotting import PlotDynamicHistory
from cbx.scheduler import multiply
import matplotlib.pyplot as plt
import numpy as np
#%%
np.random.seed(42)
f = snowflake()
N = 100
x = np.random.uniform(-2., 2., (2,N,2))
dyn = PolarCBO(f, d=2,
x=x,
alpha=1.,
#noise='anisotropic',
sigma=2.,
kappa=1.5,
verbosity=0,
track_args={'names':[
'x',
'consensus',
'drift']},
batch_args={'size':50})
dyn.optimize(sched = multiply(factor=1.02, maximum=1e10))