Reduce the experiments to restart.
177389
def get_reduced_configs(self):
        """"""
        iteration_config = self.experiment_group.iteration_config
        if iteration_config is None:
            logger.error(
                'Experiment group `%s` attempt to update iteration, but has no iteration',
                self.experiment_group.id,
                extra={'stack': True})
            return
        search_manager = self.experiment_group.search_manager

        # Get the number of experiments to keep
        n_configs_to_keep = search_manager.get_n_config_to_keep_for_iteration(
            iteration=iteration_config.iteration,
            bracket_iteration=iteration_config.bracket_iteration)

        # Get the last group's experiments metrics
        experiments_metrics = self.experiment_group.iteration_config.experiments_metrics
        if experiments_metrics is None:
            raise ExperimentGroupException()

        # Order the experiments
        reverse = Optimization.maximize(
            self.experiment_group.hptuning_config.hyperband.metric.optimization)
        experiments_metrics = sorted(experiments_metrics, key=lambda x: x[1], reverse=reverse)

        # Keep n experiments
        return [xp[0] for xp in experiments_metrics[:n_configs_to_keep]]
1174457
def reset(self):
        """"""
        self.curr_idx = 0
        random.shuffle(self.idx)
        for buck in self.data:
            np.random.shuffle(buck)

        self.nddata = []
        self.ndlabel = []
        for buck in self.data:
            label = np.empty_like(buck)
            label[:, :-1] = buck[:, 1:]
            label[:, -1] = self.invalid_label
            self.nddata.append(ndarray.array(buck, dtype=self.dtype))
            self.ndlabel.append(ndarray.array(label, dtype=self.dtype))
202902
def restart(self, *args, **kwargs):
        
        self.stop()
        try:
            self.start(*args, **kwargs)
        except IOError:
            raise
1331080
def resume_experiment(args):
    ''''''
    experiment_config = Experiments()
    experiment_dict = experiment_config.get_all_experiments()
    experiment_id = None
    experiment_endTime = None
    #find the latest stopped experiment
    if not args.id:
        print_error('Please set experiment id! \nYou could use \'nnictl resume {id}\' to resume a stopped experiment!\n' \
        'You could use \'nnictl experiment list all\' to show all of stopped experiments!')
        exit(1)
    else:
        if experiment_dict.get(args.id) is None:
            print_error('Id %s not exist!' % args.id)
            exit(1)
        if experiment_dict[args.id]['status'] != 'STOPPED':
            print_error('Experiment %s is running!' % args.id)
            exit(1)
        experiment_id = args.id
    print_normal('Resuming experiment %s...' % experiment_id)
    nni_config = Config(experiment_dict[experiment_id]['fileName'])
    experiment_config = nni_config.get_config('experimentConfig')
    experiment_id = nni_config.get_config('experimentId')
    new_config_file_name = ''.join(random.sample(string.ascii_letters + string.digits, 8))
    new_nni_config = Config(new_config_file_name)
    new_nni_config.set_config('experimentConfig', experiment_config)
    launch_experiment(args, experiment_config, 'resume', new_config_file_name, experiment_id)
    new_nni_config.set_config('restServerPort', args.port)
364443
def reset(self, params, repetition):
    """"""

    pprint.pprint(params)

    self.initialize(params, repetition)

    # Load CIFAR dataset
    dataDir = params.get('dataDir', 'data')
    self.transform_train = transforms.Compose([
      transforms.RandomCrop(32, padding=4),
      transforms.RandomHorizontalFlip(),
      transforms.ToTensor(),
      transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)),
    ])
    self.trainset = datasets.CIFAR10(root=dataDir, train=True, download=True,
                                transform=self.transform_train)

    self.createModel(params, repetition)

    print("Torch reports", torch.cuda.device_count(), "GPUs available")
    if torch.cuda.device_count() > 1:
      self.model = torch.nn.DataParallel(self.model)

    self.model.to(self.device)

    self.optimizer = self.createOptimizer(self.model)
    self.lr_scheduler = self.createLearningRateScheduler(self.optimizer)
    self.test_loaders = self.createTestLoaders(self.noise_values)
66993
def reset(self):
        """"""
        self.data     = []
        self.size     = 0
        self.kdtree   = None  # KDTree
        self.nn_ready = False
807501
public void reset() {
    Arrays.fill(mean, 0.);
    Arrays.fill(nmea, 0.);
    if(elements != null) {
      for(int i = 0; i < elements.length; i++) {
        Arrays.fill(elements[i], 0.);
      }
    }
    else {
      elements = new double[mean.length][mean.length];
    }
    wsum = 0.;
  }
274207
def delete_experiment(experiment):
    """"""
    redis = _get_redis_connection()
    experiment = Experiment.find(redis, experiment)
    if experiment:
        experiment.delete()
    return redirect(url_for('.index'))
1056712
def stop(self):
        
        self._stopped = True
        for result in self._results:
            result._set_result(Failure(ReactorStopped()))
1122216
def reset(self):
        """"""
        warnings.warn("This reset method is very crude.  It should work for "
                      "many simple simulations, but we make no guarantees. In "
                      "particular, if you have components that manage their "
                      "own state in any way, this might not work.")
        self.population._population = self._initial_population
        self.clock._time = self._start_time
1342481
protected void restartImpl(Result<I> result)
  {
    shutdownImpl(ShutdownModeAmp.GRACEFUL, Result.ignore());
    startImpl(result);
  }
1110932
def _cleanup(self):
        """"""
        current_time = time.time()
        timeout = self._config.timeout
        if current_time - self._last_cleanup_time > timeout:
            self.store.cleanup(timeout)
            self._last_cleanup_time = current_time
1209164
def stop(self, reason=None):
        """"""
        self.logger.info('stopping')
        self.loop.stop(pyev.EVBREAK_ALL)
137876
private void stop() {
		for (int i = 0; i < mDownloadDispatchers.length; i++) {
			if (mDownloadDispatchers[i] != null) {
				mDownloadDispatchers[i].quit();
			}
		}
	}
998893
public static void shutdown() {
		UdpResources resources = udpResources.getAndSet(null);
		if (resources != null) {
			resources._dispose();
		}
	}
984795
def reset
      self.repetitions = 0
      self.interval = 0
      self.due = Date.today
      self.studied_at = Date.today
      save
    end
30075
def remove(self, experiment):
        """"""
        try:
            project_path = self.projects[self[experiment]['project']]['root']
        except KeyError:
            return
        config_path = osp.join(project_path, '.project', experiment + '.yml')
        for f in [config_path, config_path + '~', config_path + '.lck']:
            if os.path.exists(f):
                os.remove(f)
        del self[experiment]