Run the optimizer
421358
def opt(self, x_init, f_fp=None, f=None, fp=None):
        
        rcstrings = ['','Maximum number of iterations exceeded', 'Gradient and/or function calls not changing']

        opt_dict = {}
        if self.xtol is not None:
            print("WARNING: bfgs doesn't have an xtol arg, so I'm going to ignore it")
        if self.ftol is not None:
            print("WARNING: bfgs doesn't have an ftol arg, so I'm going to ignore it")
        if self.gtol is not None:
            opt_dict['gtol'] = self.gtol

        opt_result = optimize.fmin_bfgs(f, x_init, fp, disp=self.messages,
                                            maxiter=self.max_iters, full_output=True, **opt_dict)
        self.x_opt = opt_result[0]
        self.f_opt = f_fp(self.x_opt)[0]
        self.funct_eval = opt_result[4]
        self.status = rcstrings[opt_result[6]]
758823
def run(self, steps=10):
        """"""
        try:
            super(GeneticMachine, self).run(steps)
            self._error = False
        except StopIteration:
            self._error = False
        except Exception:
            self._error = True
1251200
def run(self):
        """"""
        while not self._finished.isSet():
            self._func(self._reference)
            self._finished.wait(self._func._interval / 1000.0)
910443
private void optimizeStart() {
		if (configuration.isPayloadCache()) {

			if (configuration.getOptimizerStoreClass() == null) {
				store = new CacheOptimizerStore();
				store.start(configuration);
				return;
			}

			try {
				store = (OptimizerStore) Class.forName(configuration.getOptimizerStoreClass()).newInstance();
				store.start(configuration);
			} catch (ClassNotFoundException cnfe) {
				LOGGER.warn("Unable to find the class {}. The payload will be sent without optimizations.", configuration.getOptimizerStoreClass());
			} catch (InstantiationException ex) {
				LOGGER.warn("Unable to instantiate the class {}. Concrete class required.", configuration.getOptimizerStoreClass());
			} catch (IllegalAccessException ex) {
				LOGGER.warn("Unable to instantiate the class {}. Empty constructor required.", configuration.getOptimizerStoreClass());
			}
		}
	}
565390
def run(self):
        
        loop = GLib.MainLoop()
        context = loop.get_context()
        while True:
            time.sleep(0.1)
            if context.pending():
                context.iteration()
                self._manager[ATTR_POSITION] = self._position()
            try:
                method, args = self._task_queue.get(False)
                getattr(self, method)(**args)
            except queue.Empty:
                pass
            if self.state != STATE_IDLE:
                continue
            try:
                uri = self._media_queue.get(False)
                self.media(uri)
            except queue.Empty:
                pass
523958
def optimize(self, piter=3, pmaxf=300, ppert=0.1):
        '''
        

        '''

        self._save_npz()
        optimized = pPLD(self.ID, piter=piter, pmaxf=pmaxf,
                         ppert=ppert, debug=True, clobber=True)
        optimized.publish()
        self.reset()
369508
def run(self):
        
        run_command = (
            settings.project_customization.runfile.read_text().split()
        )
        chmod_string = (
            "chmod +x "
            + settings.project_customization.runfile.absolute().as_posix()
        )
        subprocess.run(chmod_string.split())
        subprocess.run(
            run_command, stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr
        )
1148284
def run(self, **kwargs):
        
        ret = None

        # initialization Y matrix and inital guess
        self.pre()
        t, _ = elapsed()

        # call solution methods
        if self.config.method == 'NR':
            ret = self.newton()
        elif self.config.method == 'DCPF':
            ret = self.dcpf()
        elif self.config.method in ('FDPF', 'FDBX', 'FDXB'):
            ret = self.fdpf()

        self.post()
        _, s = elapsed(t)

        if self.solved:
            logger.info(' Solution converged in {} in {} iterations'.format(s, self.niter))
        else:
            logger.warning(' Solution failed in {} in {} iterations'.format(s,
                           self.niter))
        return ret
700978
def optimize(self):
        """"""
        self.check_session()
        result = self.session.optimize()
        if self.autosession:
            self.commit()
        return result
987131
def run_optimization(self):
    
    penalty_val = self.params['init_penalty']
    # Don't use smoothing initially - very inaccurate for large dimension
    self.smooth_on = False
    smooth_val = 0
    learning_rate_val = self.params['init_learning_rate']
    self.current_outer_step = 1


    while self.current_outer_step <= self.params['outer_num_steps']:
      tf.logging.info('Running outer step %d with penalty %f',
                      self.current_outer_step, penalty_val)
      # Running inner loop of optimization with current_smooth_val,
      # current_penalty as smoothness parameters and penalty respectively
      self.current_step = 0
      # Run first step with random eig initialization and large number of steps
      found_cert = self.run_one_step(
          self.dual_object.m_min_vec_estimate,
          self.params['large_eig_num_steps'], smooth_val, penalty_val, learning_rate_val)
      if found_cert:
        return True
      while self.current_step < self.params['inner_num_steps']:
        self.current_step = self.current_step + 1
        found_cert = self.run_one_step(self.dual_object.m_min_vec_estimate,
                                       self.params['small_eig_num_steps'],
                                       smooth_val, penalty_val,
                                       learning_rate_val)
        if found_cert:
          return True
      # Update penalty only if it looks like current objective is optimizes
      if self.current_total_objective < UPDATE_PARAM_CONSTANT:
        penalty_val = penalty_val * self.params['beta']
        learning_rate_val = learning_rate_val*self.params['learning_rate_decay']
      else:
        # To get more accurate gradient estimate
        self.params['small_eig_num_steps'] = (
            1.5 * self.params['small_eig_num_steps'])

      # If eigen values seem small enough, turn on smoothing
      # useful only when performing full eigen decomposition
      if np.abs(self.current_eig_val_estimate) < 0.01:
        smooth_val = self.params['smoothness_parameter']
      self.current_outer_step = self.current_outer_step + 1
    return False
943724
public function actionOptimize()
    {
        $this->stdout("Optimizing translations...\n", Console::BOLD);
        $optimizer = new Optimizer();
        $items = $optimizer->run();
        $this->stdout("{$items} removed from database.\n");
    }
1138910
def run(self):
        

        space = self._get_space()
        obj_func = self._get_obj(space)
        model = self._get_model()
        acq = self._get_acquisition(model, space)
        acq_eval = self._get_acq_evaluator(acq)
                
        from ..experiment_design import initial_design
        X_init = initial_design(self.config['initialization']['type'], space, self.config['initialization']['num-eval'])

        from ..methods import ModularBayesianOptimization
        bo = ModularBayesianOptimization(model, space, obj_func, acq, acq_eval, X_init)
                
        bo.run_optimization(max_iter = self.config['resources']['maximum-iterations'], max_time = self.config['resources']['max-run-time'] if self.config['resources']['max-run-time']!="NA" else np.inf,
                              eps = self.config['resources']['tolerance'], verbosity=True)        
        return bo
767196
def run(self):
        
        self._connection = self.connect()
        self._connection.ioloop.start()
611313
def run(self):
        """"""
        if self.profile_file:
            LOGGER.info('Profiling to %s', self.profile_file)
            profile.runctx('self._run()', globals(), locals(),
                           self.profile_file)
        else:
            self._run()
        LOGGER.debug('Exiting %s (%i, %i)', self.name, os.getpid(),
                     os.getppid())
1168709
def run(self):
        
        files_to_download = self.get_files_to_download()
        total_files_size = self.get_total_files_size(files_to_download)
        if self.file_download_pre_processor:
            self.run_preprocessor(files_to_download)

        self.try_create_dir(self.dest_directory)
        watcher = ProgressPrinter(total_files_size, msg_verb='downloading')
        self.download_files(files_to_download, watcher)
        watcher.finished()

        warnings = self.check_warnings()
        if warnings:
            watcher.show_warning(warnings)
1171800
def run(self, **kwargs):
        
        from calculate import compute
        self.app_main(**kwargs)

        # get the default output name
        output = osp.join(self.exp_config['expdir'], 'output.dat')

        # save the paths in the configuration
        self.exp_config['output'] = output

        # run the model
        data = np.loadtxt(self.exp_config['infile'])
        out = compute(data)
        # save the output
        self.logger.info('Saving output data to %s', osp.relpath(output))
        np.savetxt(output, out)

        # store some additional information in the configuration of the
        # experiment
        self.exp_config['mean'] = mean = float(out.mean())
        self.exp_config['std'] = std = float(out.std())
        self.logger.debug('Mean: %s, Standard deviation: %s', mean, std)
990162
def run(self):
        """"""
        if len(self._argv) > 1 and len(self._argv[1]) > 0:
            oper = self._argv[1]
        else:
            oper = 'fetch'
        if oper == 'fetch':
            ret = self.fetch()
        elif oper == 'config':
            ret = self.config()
            if ret and self._dirtyConfig:
                ret = self.fetch()
        elif oper == 'autoconf':
            ret = self.autoconf()
            if ret:
                print "yes"
            else:
                print "no"
            ret = True
        elif oper == 'suggest':
            ret = self.suggest()
        else:
            raise AttributeError("Invalid command argument: %s" % oper)
        return ret