Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def to_flyte_idl(self):
"""
:return: _idl_parameter_ranges.ParameterRangeOneOf
"""
return _idl_parameter_ranges.ParameterRangeOneOf(
continious_parameter_range=(self.continuous_parameter_range.to_flyte_idl()
if self.continuous_parameter_range else None),
integer_parameter_range=(self.integer_parameter_range.to_flyte_idl()
if self.integer_parameter_range else None),
categorical_parameter_range=(self.categorical_parameter_range.to_flyte_idl()
if self.categorical_parameter_range else None),
)
def to_flyte_idl(self):
"""
:return: _idl_parameter_ranges.CategoricalParameterRange
"""
return _idl_parameter_ranges.CategoricalParameterRange(
values=self._values
)
def to_flyte_idl(self):
"""
:return: _idl_parameter_ranges.ContinuousParameterRange
"""
if self.scaling_type == _sdk_sagemaker_types.HyperparameterScalingType.AUTO:
scaling_type = _idl_parameter_ranges.HyperparameterScalingType.AUTO
elif self.scaling_type == _sdk_sagemaker_types.HyperparameterScalingType.LINEAR:
scaling_type = _idl_parameter_ranges.HyperparameterScalingType.LINEAR
elif self.scaling_type == _sdk_sagemaker_types.HyperparameterScalingType.LOGARITHMIC:
scaling_type = _idl_parameter_ranges.HyperparameterScalingType.LOGARITHMIC
elif self.scaling_type == _sdk_sagemaker_types.HyperparameterScalingType.REVERSELOGARITHMIC:
scaling_type = _idl_parameter_ranges.HyperparameterScalingType.REVERSELOGARITHMIC
else:
raise _user_exceptions.FlyteValidationException("Invalid SageMaker HyperparameterScalingType specified")
return _idl_parameter_ranges.ContinuousParameterRange(
max_value=self._max_value,
min_value=self._min_value,
scaling_type=scaling_type,
)
def to_flyte_idl(self):
return _idl_parameter_ranges.ParameterRanges(
parameter_range_map=self._parameter_range_map,
)
def to_flyte_idl(self):
"""
:return: _idl_parameter_ranges.IntegerParameterRange
"""
if self.scaling_type == _sdk_sagemaker_types.HyperparameterScalingType.AUTO:
scaling_type = _idl_parameter_ranges.HyperparameterScalingType.AUTO
elif self.scaling_type == _sdk_sagemaker_types.HyperparameterScalingType.LINEAR:
scaling_type = _idl_parameter_ranges.HyperparameterScalingType.LINEAR
elif self.scaling_type == _sdk_sagemaker_types.HyperparameterScalingType.LOGARITHMIC:
scaling_type = _idl_parameter_ranges.HyperparameterScalingType.LOGARITHMIC
elif self.scaling_type == _sdk_sagemaker_types.HyperparameterScalingType.REVERSELOGARITHMIC:
scaling_type = _idl_parameter_ranges.HyperparameterScalingType.REVERSELOGARITHMIC
else:
raise _user_exceptions.FlyteValidationException("Invalid SageMaker HyperparameterScalingType specified")
return _idl_parameter_ranges.IntegerParameterRange(
max_value=self._max_value,
min_value=self._min_value,
scaling_type=scaling_type,
)
"""
:return: _idl_parameter_ranges.IntegerParameterRange
"""
if self.scaling_type == _sdk_sagemaker_types.HyperparameterScalingType.AUTO:
scaling_type = _idl_parameter_ranges.HyperparameterScalingType.AUTO
elif self.scaling_type == _sdk_sagemaker_types.HyperparameterScalingType.LINEAR:
scaling_type = _idl_parameter_ranges.HyperparameterScalingType.LINEAR
elif self.scaling_type == _sdk_sagemaker_types.HyperparameterScalingType.LOGARITHMIC:
scaling_type = _idl_parameter_ranges.HyperparameterScalingType.LOGARITHMIC
elif self.scaling_type == _sdk_sagemaker_types.HyperparameterScalingType.REVERSELOGARITHMIC:
scaling_type = _idl_parameter_ranges.HyperparameterScalingType.REVERSELOGARITHMIC
else:
raise _user_exceptions.FlyteValidationException("Invalid SageMaker HyperparameterScalingType specified")
return _idl_parameter_ranges.IntegerParameterRange(
max_value=self._max_value,
min_value=self._min_value,
scaling_type=scaling_type,
)