src/orion/algo/hyperband.py
def _get_bracket(self, point):
        """Get the bracket of a point during observe"""
        fidelity = point[self.fidelity_index]
        _id_wo_fidelity = self.get_id(point)

        brackets = []
        for bracket in self.brackets:
            # If find same point in first rung of a bracket,
            # the point should register in this bracket
            if _id_wo_fidelity in bracket.rungs[0]["results"]:
                brackets = [bracket]
                break

        if not brackets:
            # If the point show in current hyeprband execution the first time,
            # the bracket with same fidelity in the first rung should be used,
            # the assumption is that there is no duplicated points inside same hyperband execution.
            brackets = [
                bracket
                for bracket in self.brackets
                if bracket.rungs[0]["resources"] == fidelity
            ]

        if not brackets:
            raise ValueError(
                "No bracket found for point {0} with fidelity {1}".format(
                    _id_wo_fidelity, fidelity
                )
            )

        if len(brackets) > 1:
            logger.warning(
                "More than one bracket found for point %s, this should not happen",
                str(point),
            )

        bracket = brackets[0]

        return bracket
Get the bracket of a point during observe
Get the bracket of a point during observe
Get the bracket of a point during observe
def _get_bracket(self, point):
        fidelity = point[self.fidelity_index]
        _id_wo_fidelity = self.get_id(point)
        brackets = []
        for bracket in self.brackets:
            if _id_wo_fidelity in bracket.rungs[0]["results"]:
                brackets = [bracket]
                break
        if not brackets:
            brackets = [
                bracket
                for bracket in self.brackets
                if bracket.rungs[0]["resources"] == fidelity
            ]
        if not brackets:
            raise ValueError(
                "No bracket found for point {0} with fidelity {1}".format(
                    _id_wo_fidelity, fidelity
                )
            )
        if len(brackets) > 1:
            logger.warning(
                "More than one bracket found for point %s, this should not happen",
                str(point),
            )
        bracket = brackets[0]
        return bracket
def _get_bracket ( self , point ) : fidelity = point [ self . fidelity_index ] _id_wo_fidelity = self . get_id ( point ) brackets = [ ] for bracket in self . brackets : if _id_wo_fidelity in bracket . rungs [ 0 ] [ "results" ] : brackets = [ bracket ] break if not brackets : brackets = [ bracket for bracket in self . brackets if bracket . rungs [ 0 ] [ "resources" ] == fidelity ] if not brackets : raise ValueError ( "No bracket found for point {0} with fidelity {1}" . format ( _id_wo_fidelity , fidelity ) ) if len ( brackets ) > 1 : logger . warning ( "More than one bracket found for point %s, this should not happen" , str ( point ) , ) bracket = brackets [ 0 ] return bracket
Get the bracket of a point during observe
Get the bracket of a point during observe
"""Get the bracket of a point during observe""" # If find same point in first rung of a bracket, # the point should register in this bracket # If the point show in current hyeprband execution the first time, # the bracket with same fidelity in the first rung should be used, # the assumption is that there is no duplicated points inside same hyperband execution.
self
point