CfnAlgorithmProps Struct
Properties for defining a CfnAlgorithm.
| Source | |
|---|---|
| Type last changed |
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_sagemaker as sagemaker } from 'aws-cdk-lib';
const cfnAlgorithmProps: sagemaker.CfnAlgorithmProps = {
algorithmName: 'algorithmName',
trainingSpecification: {
supportedTrainingInstanceTypes: ['supportedTrainingInstanceTypes'],
trainingChannels: [{
name: 'name',
supportedContentTypes: ['supportedContentTypes'],
supportedInputModes: ['supportedInputModes'],
// the properties below are optional
description: 'description',
isRequired: false,
supportedCompressionTypes: ['supportedCompressionTypes'],
}],
trainingImage: 'trainingImage',
// the properties below are optional
metricDefinitions: [{
name: 'name',
regex: 'regex',
}],
supportedHyperParameters: [{
name: 'name',
type: 'type',
// the properties below are optional
defaultValue: 'defaultValue',
description: 'description',
isRequired: false,
isTunable: false,
range: {
categoricalParameterRangeSpecification: {
values: ['values'],
},
continuousParameterRangeSpecification: {
maxValue: 'maxValue',
minValue: 'minValue',
},
integerParameterRangeSpecification: {
maxValue: 'maxValue',
minValue: 'minValue',
},
},
}],
supportedTuningJobObjectiveMetrics: [{
metricName: 'metricName',
type: 'type',
}],
supportsDistributedTraining: false,
trainingImageDigest: 'trainingImageDigest',
},
// the properties below are optional
algorithmDescription: 'algorithmDescription',
certifyForMarketplace: false,
inferenceSpecification: {
containers: [{
image: 'image',
// the properties below are optional
containerHostname: 'containerHostname',
environment: {
environmentKey: 'environment',
},
framework: 'framework',
frameworkVersion: 'frameworkVersion',
imageDigest: 'imageDigest',
isCheckpoint: false,
modelInput: {
dataInputConfig: 'dataInputConfig',
},
nearestModelName: 'nearestModelName',
}],
// the properties below are optional
supportedContentTypes: ['supportedContentTypes'],
supportedRealtimeInferenceInstanceTypes: ['supportedRealtimeInferenceInstanceTypes'],
supportedResponseMimeTypes: ['supportedResponseMimeTypes'],
supportedTransformInstanceTypes: ['supportedTransformInstanceTypes'],
},
tags: [{
key: 'key',
value: 'value',
}],
};
python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_sagemaker as sagemaker
cfn_algorithm_props = sagemaker.CfnAlgorithmProps(
algorithm_name="algorithmName",
training_specification=sagemaker.CfnAlgorithm.TrainingSpecificationProperty(
supported_training_instance_types=["supportedTrainingInstanceTypes"],
training_channels=[sagemaker.CfnAlgorithm.ChannelSpecificationProperty(
name="name",
supported_content_types=["supportedContentTypes"],
supported_input_modes=["supportedInputModes"],
# the properties below are optional
description="description",
is_required=False,
supported_compression_types=["supportedCompressionTypes"]
)],
training_image="trainingImage",
# the properties below are optional
metric_definitions=[sagemaker.CfnAlgorithm.MetricDefinitionProperty(
name="name",
regex="regex"
)],
supported_hyper_parameters=[sagemaker.CfnAlgorithm.HyperParameterSpecificationProperty(
name="name",
type="type",
# the properties below are optional
default_value="defaultValue",
description="description",
is_required=False,
is_tunable=False,
range=sagemaker.CfnAlgorithm.ParameterRangeProperty(
categorical_parameter_range_specification=sagemaker.CfnAlgorithm.CategoricalParameterRangeSpecificationProperty(
values=["values"]
),
continuous_parameter_range_specification=sagemaker.CfnAlgorithm.ContinuousParameterRangeSpecificationProperty(
max_value="maxValue",
min_value="minValue"
),
integer_parameter_range_specification=sagemaker.CfnAlgorithm.IntegerParameterRangeSpecificationProperty(
max_value="maxValue",
min_value="minValue"
)
)
)],
supported_tuning_job_objective_metrics=[sagemaker.CfnAlgorithm.HyperParameterTuningJobObjectiveProperty(
metric_name="metricName",
type="type"
)],
supports_distributed_training=False,
training_image_digest="trainingImageDigest"
),
# the properties below are optional
algorithm_description="algorithmDescription",
certify_for_marketplace=False,
inference_specification=sagemaker.CfnAlgorithm.InferenceSpecificationProperty(
containers=[sagemaker.CfnAlgorithm.ModelPackageContainerDefinitionProperty(
image="image",
# the properties below are optional
container_hostname="containerHostname",
environment={
"environment_key": "environment"
},
framework="framework",
framework_version="frameworkVersion",
image_digest="imageDigest",
is_checkpoint=False,
model_input=sagemaker.CfnAlgorithm.ModelInputProperty(
data_input_config="dataInputConfig"
),
nearest_model_name="nearestModelName"
)],
# the properties below are optional
supported_content_types=["supportedContentTypes"],
supported_realtime_inference_instance_types=["supportedRealtimeInferenceInstanceTypes"],
supported_response_mime_types=["supportedResponseMimeTypes"],
supported_transform_instance_types=["supportedTransformInstanceTypes"]
),
tags=[CfnTag(
key="key",
value="value"
)]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.sagemaker.*;
CfnAlgorithmProps cfnAlgorithmProps = CfnAlgorithmProps.builder()
.algorithmName("algorithmName")
.trainingSpecification(TrainingSpecificationProperty.builder()
.supportedTrainingInstanceTypes(List.of("supportedTrainingInstanceTypes"))
.trainingChannels(List.of(ChannelSpecificationProperty.builder()
.name("name")
.supportedContentTypes(List.of("supportedContentTypes"))
.supportedInputModes(List.of("supportedInputModes"))
// the properties below are optional
.description("description")
.isRequired(false)
.supportedCompressionTypes(List.of("supportedCompressionTypes"))
.build()))
.trainingImage("trainingImage")
// the properties below are optional
.metricDefinitions(List.of(MetricDefinitionProperty.builder()
.name("name")
.regex("regex")
.build()))
.supportedHyperParameters(List.of(HyperParameterSpecificationProperty.builder()
.name("name")
.type("type")
// the properties below are optional
.defaultValue("defaultValue")
.description("description")
.isRequired(false)
.isTunable(false)
.range(ParameterRangeProperty.builder()
.categoricalParameterRangeSpecification(CategoricalParameterRangeSpecificationProperty.builder()
.values(List.of("values"))
.build())
.continuousParameterRangeSpecification(ContinuousParameterRangeSpecificationProperty.builder()
.maxValue("maxValue")
.minValue("minValue")
.build())
.integerParameterRangeSpecification(IntegerParameterRangeSpecificationProperty.builder()
.maxValue("maxValue")
.minValue("minValue")
.build())
.build())
.build()))
.supportedTuningJobObjectiveMetrics(List.of(HyperParameterTuningJobObjectiveProperty.builder()
.metricName("metricName")
.type("type")
.build()))
.supportsDistributedTraining(false)
.trainingImageDigest("trainingImageDigest")
.build())
// the properties below are optional
.algorithmDescription("algorithmDescription")
.certifyForMarketplace(false)
.inferenceSpecification(InferenceSpecificationProperty.builder()
.containers(List.of(ModelPackageContainerDefinitionProperty.builder()
.image("image")
// the properties below are optional
.containerHostname("containerHostname")
.environment(Map.of(
"environmentKey", "environment"))
.framework("framework")
.frameworkVersion("frameworkVersion")
.imageDigest("imageDigest")
.isCheckpoint(false)
.modelInput(ModelInputProperty.builder()
.dataInputConfig("dataInputConfig")
.build())
.nearestModelName("nearestModelName")
.build()))
// the properties below are optional
.supportedContentTypes(List.of("supportedContentTypes"))
.supportedRealtimeInferenceInstanceTypes(List.of("supportedRealtimeInferenceInstanceTypes"))
.supportedResponseMimeTypes(List.of("supportedResponseMimeTypes"))
.supportedTransformInstanceTypes(List.of("supportedTransformInstanceTypes"))
.build())
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Sagemaker;
var cfnAlgorithmProps = new CfnAlgorithmProps {
AlgorithmName = "algorithmName",
TrainingSpecification = new TrainingSpecificationProperty {
SupportedTrainingInstanceTypes = new [] { "supportedTrainingInstanceTypes" },
TrainingChannels = new [] { new ChannelSpecificationProperty {
Name = "name",
SupportedContentTypes = new [] { "supportedContentTypes" },
SupportedInputModes = new [] { "supportedInputModes" },
// the properties below are optional
Description = "description",
IsRequired = false,
SupportedCompressionTypes = new [] { "supportedCompressionTypes" }
} },
TrainingImage = "trainingImage",
// the properties below are optional
MetricDefinitions = new [] { new MetricDefinitionProperty {
Name = "name",
Regex = "regex"
} },
SupportedHyperParameters = new [] { new HyperParameterSpecificationProperty {
Name = "name",
Type = "type",
// the properties below are optional
DefaultValue = "defaultValue",
Description = "description",
IsRequired = false,
IsTunable = false,
Range = new ParameterRangeProperty {
CategoricalParameterRangeSpecification = new CategoricalParameterRangeSpecificationProperty {
Values = new [] { "values" }
},
ContinuousParameterRangeSpecification = new ContinuousParameterRangeSpecificationProperty {
MaxValue = "maxValue",
MinValue = "minValue"
},
IntegerParameterRangeSpecification = new IntegerParameterRangeSpecificationProperty {
MaxValue = "maxValue",
MinValue = "minValue"
}
}
} },
SupportedTuningJobObjectiveMetrics = new [] { new HyperParameterTuningJobObjectiveProperty {
MetricName = "metricName",
Type = "type"
} },
SupportsDistributedTraining = false,
TrainingImageDigest = "trainingImageDigest"
},
// the properties below are optional
AlgorithmDescription = "algorithmDescription",
CertifyForMarketplace = false,
InferenceSpecification = new InferenceSpecificationProperty {
Containers = new [] { new ModelPackageContainerDefinitionProperty {
Image = "image",
// the properties below are optional
ContainerHostname = "containerHostname",
Environment = new Dictionary<string, string> {
{ "environmentKey", "environment" }
},
Framework = "framework",
FrameworkVersion = "frameworkVersion",
ImageDigest = "imageDigest",
IsCheckpoint = false,
ModelInput = new ModelInputProperty {
DataInputConfig = "dataInputConfig"
},
NearestModelName = "nearestModelName"
} },
// the properties below are optional
SupportedContentTypes = new [] { "supportedContentTypes" },
SupportedRealtimeInferenceInstanceTypes = new [] { "supportedRealtimeInferenceInstanceTypes" },
SupportedResponseMimeTypes = new [] { "supportedResponseMimeTypes" },
SupportedTransformInstanceTypes = new [] { "supportedTransformInstanceTypes" }
},
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
cfnAlgorithmProps := &CfnAlgorithmProps{
AlgorithmName: jsii.String("algorithmName"),
TrainingSpecification: &TrainingSpecificationProperty{
SupportedTrainingInstanceTypes: []*string{
jsii.String("supportedTrainingInstanceTypes"),
},
TrainingChannels: []interface{}{
&ChannelSpecificationProperty{
Name: jsii.String("name"),
SupportedContentTypes: []*string{
jsii.String("supportedContentTypes"),
},
SupportedInputModes: []*string{
jsii.String("supportedInputModes"),
},
// the properties below are optional
Description: jsii.String("description"),
IsRequired: jsii.Boolean(false),
SupportedCompressionTypes: []*string{
jsii.String("supportedCompressionTypes"),
},
},
},
TrainingImage: jsii.String("trainingImage"),
// the properties below are optional
MetricDefinitions: []interface{}{
&MetricDefinitionProperty{
Name: jsii.String("name"),
Regex: jsii.String("regex"),
},
},
SupportedHyperParameters: []interface{}{
&HyperParameterSpecificationProperty{
Name: jsii.String("name"),
Type: jsii.String("type"),
// the properties below are optional
DefaultValue: jsii.String("defaultValue"),
Description: jsii.String("description"),
IsRequired: jsii.Boolean(false),
IsTunable: jsii.Boolean(false),
Range: &ParameterRangeProperty{
CategoricalParameterRangeSpecification: &CategoricalParameterRangeSpecificationProperty{
Values: []*string{
jsii.String("values"),
},
},
ContinuousParameterRangeSpecification: &ContinuousParameterRangeSpecificationProperty{
MaxValue: jsii.String("maxValue"),
MinValue: jsii.String("minValue"),
},
IntegerParameterRangeSpecification: &IntegerParameterRangeSpecificationProperty{
MaxValue: jsii.String("maxValue"),
MinValue: jsii.String("minValue"),
},
},
},
},
SupportedTuningJobObjectiveMetrics: []interface{}{
&HyperParameterTuningJobObjectiveProperty{
MetricName: jsii.String("metricName"),
Type: jsii.String("type"),
},
},
SupportsDistributedTraining: jsii.Boolean(false),
TrainingImageDigest: jsii.String("trainingImageDigest"),
},
// the properties below are optional
AlgorithmDescription: jsii.String("algorithmDescription"),
CertifyForMarketplace: jsii.Boolean(false),
InferenceSpecification: &InferenceSpecificationProperty{
Containers: []interface{}{
&ModelPackageContainerDefinitionProperty{
Image: jsii.String("image"),
// the properties below are optional
ContainerHostname: jsii.String("containerHostname"),
Environment: map[string]*string{
"environmentKey": jsii.String("environment"),
},
Framework: jsii.String("framework"),
FrameworkVersion: jsii.String("frameworkVersion"),
ImageDigest: jsii.String("imageDigest"),
IsCheckpoint: jsii.Boolean(false),
ModelInput: &ModelInputProperty{
DataInputConfig: jsii.String("dataInputConfig"),
},
NearestModelName: jsii.String("nearestModelName"),
},
},
// the properties below are optional
SupportedContentTypes: []*string{
jsii.String("supportedContentTypes"),
},
SupportedRealtimeInferenceInstanceTypes: []*string{
jsii.String("supportedRealtimeInferenceInstanceTypes"),
},
SupportedResponseMimeTypes: []*string{
jsii.String("supportedResponseMimeTypes"),
},
SupportedTransformInstanceTypes: []*string{
jsii.String("supportedTransformInstanceTypes"),
},
},
Tags: []CfnTag{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
}
Properties
algorithmDescriptionoptionalstringalgorithm_descriptionoptionalstralgorithmDescriptionoptionalStringAlgorithmDescriptionoptionalstringAlgorithmDescriptionoptional*string #A description of the algorithm.
algorithmNamestringalgorithm_namestralgorithmNameStringAlgorithmNamestringAlgorithmName*string required #The name of the algorithm.
certifyForMarketplaceoptionalboolean | IResolvablecertify_for_marketplaceoptionaltyping.Union[bool, IResolvable]certifyForMarketplaceoptionalBooleanCertifyForMarketplaceoptionalboolCertifyForMarketplaceoptionalinterface{} #Whether to certify the algorithm so that it can be listed in AWS Marketplace.
inferenceSpecificationoptionalIResolvable | CfnAlgorithm.inference_specificationoptionaltyping.Union[IResolvable, InferenceSpecificationProperty]inferenceSpecificationoptionalIResolvableInferenceSpecificationoptionalIResolvableInferenceSpecificationoptionalinterface{} #tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #An array of key-value pairs to apply to this resource.
trainingSpecificationIResolvable | CfnAlgorithm.training_specificationtyping.Union[IResolvable, TrainingSpecificationProperty]trainingSpecificationIResolvableTrainingSpecificationIResolvableTrainingSpecificationinterface{} required #