Exemple #1
0
 specs = SpecService.generate_dict_multiple_spec(
     n_specs=n_specs,
     problem_names=problem_name,
     dim_xs=dim_x,
     bounds_domain_xs=bounds_domain_x,
     training_names=training_name,
     type_kernels=type_kernel,
     dimensionss=dimensions,
     bounds_domains=bounds_domain,
     number_points_each_dimensions=number_points_each_dimension,
     n_trainings=n_training,
     random_seeds=random_seed,
     type_boundss=type_bounds,
     x_domains=x_domain,
     mles=mle,
     distributions=distribution,
     parallels=parallel,
     thinnings=thinning,
     n_burnings=n_burning,
     max_steps_outs=max_steps_out,
     n_iterationss=n_iterations,
     same_correlations=same_correlation,
     debugs=debug,
     number_points_each_dimension_debugs=number_points_each_dimension_debug,
     monte_carlo_sbos=monte_carlo_sbo,
     n_samples_mcs=n_samples_mc,
     n_restarts_mcs=n_restarts_mc,
     factr_mcs=factr_mc,
     maxiter_mcs=maxiter_mc,
     n_restartss=n_restarts,
     n_best_restartss=n_best_restarts,
     use_only_training_pointss=use_only_training_points,
     method_optimizations=method_optimization,
     n_samples_parameterss=n_samples_parameters,
     n_restarts_means=n_restarts_mean,
     n_best_restarts_means=n_best_restarts_mean,
     n_best_restarts_mcs=n_best_restarts_mc,
     maxepochs=maxepoch,
     method_opt_mcs=method_opt_mc,
     n_samples_parameters_means=n_samples_parameters_mean,
     maxepoch_means=maxepoch_mean,
     threshold_sbos=threshold_sbo,
     parallel_trainings=parallel_training,
     noises=noises,
     n_sampless=n_sampless,
     parameters_distributions=parameters_distributions,
     optimize_only_posterior_means=optimize_only_posterior_means,
     start_optimize_posterior_means=start_optimize_posterior_means,
     simplex_domain=simplex_domain)
    def test_generate_dic_specs(self):
        specs = SpecService.generate_dict_multiple_spec(
            1, self.problem_names, self.dim_xs, self.bounds_domain_xs,
            [self.training_name], [self.type_kernel], [self.dimensions])

        assert specs == {
            'problem_names': self.problem_names,
            'dim_xs': self.dim_xs,
            'bounds_domain_xs': self.bounds_domain_xs,
            'training_names': [self.training_name],
            'bounds_domains': self.bounds_domain_xs,
            'number_points_each_dimensions': [[10]],
            'choose_noises': [True],
            'method_optimizations': ['sbo'],
            'type_boundss': [[0]],
            'n_trainings': [10],
            'pointss': [[]],
            'noises': [False],
            'n_sampless': [0],
            'random_seeds': [1],
            'parallels': [True],
            'type_kernels': [[SCALED_KERNEL, MATERN52_NAME]],
            'dimensionss': [[1]],
            'name_models': ['gp_fitting_gaussian'],
            'mles': [True],
            'thinnings': [0],
            'n_burnings': [0],
            'max_steps_outs': [1],
            'training_datas': [{}],
            'distributions': [UNIFORM_FINITE],
            'minimizes': [False],
            'n_iterationss': [5],
            'parameters_distributions': [{}],
            'x_domains': [[]],
            'kernel_valuess': [[]],
            'mean_values': [[]],
            'var_noise_values': [[]],
        }

        specs_ = SpecService.generate_dict_multiple_spec(
            2, ['toy', 'toy_2'], [1, 2], [[[2, 3]], [[5, 8]]],
            [self.training_name, 'test_spec_2'], [self.type_kernel],
            [self.dimensions])

        assert specs_ == {
            'problem_names': ['toy', 'toy_2'],
            'dim_xs': [1, 2],
            'bounds_domain_xs': [[[2, 3]], [[5, 8]]],
            'training_names': [self.training_name, 'test_spec_2'],
            'bounds_domains': [[[2, 3]], [[5, 8]]],
            'number_points_each_dimensions': [[10], [10, 10]],
            'choose_noises': [True, True],
            'method_optimizations': ['sbo', 'sbo'],
            'type_boundss': [[0], [0]],
            'n_trainings': [10, 10],
            'pointss': [[], []],
            'noises': [False, False],
            'n_sampless': [0, 0],
            'random_seeds': [1, 1],
            'parallels': [True, True],
            'type_kernels': [[SCALED_KERNEL, MATERN52_NAME],
                             [SCALED_KERNEL, MATERN52_NAME]],
            'dimensionss': [[1], [1]],
            'name_models': ['gp_fitting_gaussian', 'gp_fitting_gaussian'],
            'mles': [True, True],
            'thinnings': [0, 0],
            'n_burnings': [0, 0],
            'max_steps_outs': [1, 1],
            'training_datas': [{}, {}],
            'distributions': [UNIFORM_FINITE, UNIFORM_FINITE],
            'minimizes': [False, False],
            'n_iterationss': [5, 5],
            'parameters_distributions': [{}, {}],
            'x_domains': [[], []],
            'kernel_valuess': [[], []],
            'mean_values': [[], []],
            'var_noise_values': [[], []],
        }