Ejemplo n.º 1
0
 def __init__(self, child: Hyperparameter, parent: Hyperparameter,
              value: Union[str, float, int]) -> None:
     super(NotEqualsCondition, self).__init__(child, parent)
     if not parent.is_legal(value):
         raise ValueError("Hyperparameter '%s' is "
                          "conditional on the illegal value '%s' of "
                          "its parent hyperparameter '%s'" %
                          (child.name, value, parent.name))
     self.value = value
Ejemplo n.º 2
0
 def __init__(self, child: Hyperparameter, parent: Hyperparameter, value: Union[str, float, int]) -> None:
     super(NotEqualsCondition, self).__init__(child, parent)
     if not parent.is_legal(value):
         raise ValueError("Hyperparameter '%s' is "
                          "conditional on the illegal value '%s' of "
                          "its parent hyperparameter '%s'" %
                          (child.name, value, parent.name))
     self.value = value
     self.vector_value = self.parent._inverse_transform(self.value)
Ejemplo n.º 3
0
 def __init__(self, child: Hyperparameter, parent: Hyperparameter,
              value: Union[str, float, int]) -> None:
     super(GreaterThanCondition, self).__init__(child, parent)
     self.parent.allow_greater_less_comparison()
     if not parent.is_legal(value):
         raise ValueError("Hyperparameter '%s' is "
                          "conditional on the illegal value '%s' of "
                          "its parent hyperparameter '%s'" %
                          (child.name, value, parent.name))
     self.value = value
Ejemplo n.º 4
0
 def __init__(self, child: Hyperparameter, parent: Hyperparameter, values: List[Union[str, float, int]]) -> None:
     super(InCondition, self).__init__(child, parent)
     for value in values:
         if not parent.is_legal(value):
             raise ValueError("Hyperparameter '%s' is "
                              "conditional on the illegal value '%s' of "
                              "its parent hyperparameter '%s'" %
                              (child.name, value, parent.name))
     self.values = values
     self.vector_values = [self.parent._inverse_transform(value) for value in self.values]
Ejemplo n.º 5
0
 def __init__(self, hyperparameter: Hyperparameter, value: Any) -> None:
     super(SingleValueForbiddenClause, self).__init__()
     if not isinstance(hyperparameter, Hyperparameter):
         raise TypeError("'%s' is not of type %s." %
                         (str(hyperparameter), Hyperparameter))
     self.hyperparameter = hyperparameter
     if not hyperparameter.is_legal(value):
         raise ValueError("Forbidden clause must be instantiated with a "
                          "legal hyperparameter value for '%s', but got "
                          "'%s'" % (hyperparameter, str(value)))
     self.value = value
Ejemplo n.º 6
0
 def __init__(self, hyperparameter: Hyperparameter, values: Any) -> None:
     super(MultipleValueForbiddenClause, self).__init__()
     if not isinstance(hyperparameter, Hyperparameter):
         raise TypeError("Argument 'hyperparameter' is not of type %s." %
                         Hyperparameter)
     self.hyperparameter = hyperparameter
     for value in values:
         if not hyperparameter.is_legal(value):
             raise ValueError("Forbidden clause must be instantiated with a "
                              "legal hyperparameter value for '%s', but got "
                              "'%s'" % (hyperparameter, str(value)))
     self.values = values
Ejemplo n.º 7
0
 def __init__(self, child: Hyperparameter, parent: Hyperparameter,
              values: List[Union[str, float, int]]) -> None:
     super(InCondition, self).__init__(child, parent)
     for value in values:
         if not parent.is_legal(value):
             raise ValueError("Hyperparameter '%s' is "
                              "conditional on the illegal value '%s' of "
                              "its parent hyperparameter '%s'" %
                              (child.name, value, parent.name))
     self.values = values
     self.vector_values = [
         self.parent._inverse_transform(value) for value in self.values
     ]