def __init__( self, ccm, alpha0=1e-3, beta1=0.9, beta2=0.999, beta3=0.9, noise=1e-8, maxit=100, epsilon=1e-5, convergence_prev=5, early_stopping=False, decay_type="step", decay_rate=1e1, decay=False, decay_start=1e-4, fix_v=False, plotfile=None): self.alpha0 = alpha0 self.beta1 = beta1 self.beta2 = beta2 self.beta3 = beta3 self.noise = noise self.decay=decay self.it_succesfull_stop_condition=-1 self.decay_rate = decay_rate self.decay_start = decay_start self.decay_type = decay_type self.fix_v = fix_v self.maxit = maxit self.early_stopping = early_stopping self.epsilon = epsilon self.convergence_prev=convergence_prev plot_title = "L={0} N={1} Neff={2} Diversity={3}<br>".format( ccm.L, ccm.N, np.round(ccm.neff, decimals=3), np.round(ccm.diversity, decimals=3) ) self.progress = pr.Progress(plotfile, plot_title) if self.alpha0 == 0: self.alpha0 = 2e-3 * np.log(ccm.neff)
def initiate_logging(self, plot_file=None): # setup progress logging self.progress = pr.Progress() if plot_file is not None: plot_title = "L={0} N={1} Neff={2} Diversity={3}<br>".format( self.L, self.N, np.round(self.neff, decimals=3), np.round(self.diversity, decimals=3)) self.progress.set_plot_title(plot_title) if plot_file.split(".")[-1] != "html": plot_file += ".html" print("Plot with optimization statistics will be written to {0}".format(plot_file)) self.progress.set_plot_file(plot_file)
def __init__(self, ccm, maxit=100, alpha0=5e-3, decay=True, decay_start=1e-3, decay_rate=10, decay_type="lin", fix_v=False, epsilon=1e-5, convergence_prev=5, early_stopping=False, plotfile=None): self.maxit = maxit self.alpha0 = alpha0 #decay settings self.decay = decay self.decay_start = decay_start self.decay_rate = np.float(decay_rate) self.decay_type = decay_type self.it_succesfull_stop_condition = -1 self.fix_v = fix_v self.early_stopping = early_stopping self.epsilon = epsilon self.convergence_prev = convergence_prev plot_title = "L={0} N={1} Neff={2} Diversity={3}<br>".format( ccm.L, ccm.N, np.round(ccm.neff, decimals=3), np.round(ccm.diversity, decimals=3)) self.progress = pr.Progress(plotfile, plot_title) if self.alpha0 == 0: self.alpha0 = 5e-2 / np.sqrt(ccm.neff)
def __init__(self, ccm, maxit=100, ftol=1e-4, max_linesearch=5, alpha_mul=0.5, wolfe=0.2, epsilon=1e-3, convergence_prev=5, plotfile=None): self.maxit = maxit self.ftol = ftol self.max_linesearch = max_linesearch self.alpha_mul = alpha_mul self.wolfe = wolfe self.epsilon = epsilon self.convergence_prev = convergence_prev plot_title = "L={0} N={1} Neff={2} Diversity={3}<br>".format( ccm.L, ccm.N, np.round(ccm.neff, decimals=3), np.round(ccm.diversity, decimals=3)) self.progress = pr.Progress(plotfile, plot_title) self.g_x = None