How to use the flyteidl.plugins.sagemaker.parameter_ranges_pb2 function in flyteidl

To help you get started, we’ve selected a few flyteidl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lyft / flytekit / flytekit / models / sagemaker / parameter_ranges.py View on Github external
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),
        )
github lyft / flytekit / flytekit / models / sagemaker / parameter_ranges.py View on Github external
def to_flyte_idl(self):
        """
        :return: _idl_parameter_ranges.CategoricalParameterRange
        """
        return _idl_parameter_ranges.CategoricalParameterRange(
            values=self._values
        )
github lyft / flytekit / flytekit / models / sagemaker / parameter_ranges.py View on Github external
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,
        )
github lyft / flytekit / flytekit / models / sagemaker / parameter_ranges.py View on Github external
def to_flyte_idl(self):
        return _idl_parameter_ranges.ParameterRanges(
            parameter_range_map=self._parameter_range_map,
        )
github lyft / flytekit / flytekit / models / sagemaker / parameter_ranges.py View on Github external
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,
        )
github lyft / flytekit / flytekit / models / sagemaker / parameter_ranges.py View on Github external
"""
        :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,
        )