Esempio n. 1
0
    def tell_examples(self, new_examples):
        """Special method that allows fast updating of the backend with new examples."""
        data_points, losses = split_examples(new_examples, self.params)
        self.result = self.optimizer.tell(data_points, losses)

        current_point = self.optimizer.ask()
        self.current_values = make_values(self.params, current_point)
Esempio n. 2
0
    def __init__(self, examples, params, base_estimator="gp", **options):
        self.init_fallback_backend()

        if not examples:
            self.current_values = {}
            return

        data_points, losses = split_examples(examples, params)
        dimensions = create_dimensions(params)

        if isinstance(base_estimator, str):
            base_estimator = py_str(base_estimator)

        self.optimizer = Optimizer(dimensions, base_estimator, **options)
        self.result = self.optimizer.tell(data_points, losses)
        current_point = self.optimizer.ask()

        self.current_values = make_values(params, current_point)
Esempio n. 3
0
    def __init__(self, examples, params, base_estimator="gp", **options):
        self.init_fallback_backend()

        if not examples:
            self.current_values = {}
            return

        data_points, losses = split_examples(examples, params)
        dimensions = [
            create_dimension(name, func, *args)
            for name, (func, args, kwargs) in sorted_items(params)
        ]

        if isinstance(base_estimator, str):
            base_estimator = py_str(base_estimator)

        optimizer = Optimizer(dimensions, base_estimator, **options)
        optimizer.tell(data_points, losses)
        current_point = optimizer.ask()

        self.current_values = make_values(params, current_point)