src/orion/algo/tpe.py
def _sample_int_point(self, dimension, below_points, above_points):
        """Sample one value for integer dimension based on the observed good and bad points"""
        low, high = dimension.interval()
        choices = range(low, high)

        below_points = numpy.array(below_points).astype(int) - low
        above_points = numpy.array(above_points).astype(int) - low

        sampler_below = CategoricalSampler(self, below_points, choices)
        candidate_points = sampler_below.sample(self.n_ei_candidates)

        if list(candidate_points):
            sampler_above = CategoricalSampler(self, above_points, choices)

            lik_below = sampler_below.get_loglikelis(candidate_points)
            lik_above = sampler_above.get_loglikelis(candidate_points)

            new_point = compute_max_ei_point(candidate_points, lik_below, lik_above)
            new_point = new_point + low
            return new_point

        return None
Sample one value for integer dimension based on the observed good and bad points
Sample one value for integer dimension based on the observed good and bad points
Sample one value for integer dimension based on the observed good and bad points
def _sample_int_point(self, dimension, below_points, above_points):
        low, high = dimension.interval()
        choices = range(low, high)
        below_points = numpy.array(below_points).astype(int) - low
        above_points = numpy.array(above_points).astype(int) - low
        sampler_below = CategoricalSampler(self, below_points, choices)
        candidate_points = sampler_below.sample(self.n_ei_candidates)
        if list(candidate_points):
            sampler_above = CategoricalSampler(self, above_points, choices)
            lik_below = sampler_below.get_loglikelis(candidate_points)
            lik_above = sampler_above.get_loglikelis(candidate_points)
            new_point = compute_max_ei_point(candidate_points, lik_below, lik_above)
            new_point = new_point + low
            return new_point
        return None
def _sample_int_point ( self , dimension , below_points , above_points ) : low , high = dimension . interval ( ) choices = range ( low , high ) below_points = numpy . array ( below_points ) . astype ( int ) - low above_points = numpy . array ( above_points ) . astype ( int ) - low sampler_below = CategoricalSampler ( self , below_points , choices ) candidate_points = sampler_below . sample ( self . n_ei_candidates ) if list ( candidate_points ) : sampler_above = CategoricalSampler ( self , above_points , choices ) lik_below = sampler_below . get_loglikelis ( candidate_points ) lik_above = sampler_above . get_loglikelis ( candidate_points ) new_point = compute_max_ei_point ( candidate_points , lik_below , lik_above ) new_point = new_point + low return new_point return None
Sample one value for integer dimension based on the observed good and bad points
Sample one value for integer dimension based on the observed good and bad points
"""Sample one value for integer dimension based on the observed good and bad points"""
self
dimension
below_points
above_points