ModelVersion
- Implements: IModelVersion
This class encapsulates and extends the ROS resource type ALIYUN::PAI::ModelVersion.
Initializers
import com.aliyun.ros.cdk.pai.ModelVersion;
ModelVersion.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
.modelId(java.lang.String)
.modelId(IResolvable)
.uri(java.lang.String)
.uri(IResolvable)
// .approvalStatus(java.lang.String)
// .approvalStatus(IResolvable)
// .extraInfo(IResolvable)
// .extraInfo(java.util.Map<java.lang.String, java.lang.Object>)
// .formatType(java.lang.String)
// .formatType(IResolvable)
// .frameworkType(java.lang.String)
// .frameworkType(IResolvable)
// .inferenceSpec(IResolvable)
// .inferenceSpec(java.util.Map<java.lang.String, java.lang.Object>)
// .labels(IResolvable)
// .labels(java.util.List<IResolvable)
// .labels(LabelsProperty>)
// .metrics(IResolvable)
// .metrics(java.util.Map<java.lang.String, java.lang.Object>)
// .options(java.lang.String)
// .options(IResolvable)
// .sourceId(java.lang.String)
// .sourceId(IResolvable)
// .sourceType(java.lang.String)
// .sourceType(IResolvable)
// .trainingSpec(IResolvable)
// .trainingSpec(java.util.Map<java.lang.String, java.lang.Object>)
// .versionDescription(java.lang.String)
// .versionDescription(IResolvable)
// .versionName(java.lang.String)
// .versionName(IResolvable)
.build();
| Name | Type | Description |
|---|---|---|
scope | com.aliyun.ros.cdk.core.Construct | No description. |
id | java.lang.String | No description. |
enableResourcePropertyConstraint | java.lang.Boolean | No description. |
modelId | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property modelId: Model ID. |
uri | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property uri: Model version URI, that is, the location where the model is stored. |
approvalStatus | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property approvalStatus: Admission status, with values as follows: - Pending: to be determined. |
extraInfo | com.aliyun.ros.cdk.core.IResolvable OR java.util.Map | Property extraInfo: The additional information. |
formatType | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property formatType: Model format, possible values: - OfflineModel - SavedModel - Keras H5 - Frozen Pb - Caffe Prototxt - TorchScript - XGBoost - PMML - AlinkModel - ONNX. |
frameworkType | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property frameworkType: Model framework, possible values: - Pytorch - XGBoost - Keras - Caffe - Alink - Xflow - TensorFlow. |
inferenceSpec | com.aliyun.ros.cdk.core.IResolvable OR java.util.Map | Property inferenceSpec: Describes how to apply to downstream inference services. |
labels | com.aliyun.ros.cdk.core.IResolvable OR java.util.List | Property labels: List of model version labels. |
metrics | com.aliyun.ros.cdk.core.IResolvable OR java.util.Map | Property metrics: The metrics for the model. |
options | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property options: The extended field. |
sourceId | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property sourceId: Source ID. |
sourceType | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property sourceType: Model source type, possible values: - Custom: Custom. |
trainingSpec | com.aliyun.ros.cdk.core.IResolvable OR java.util.Map | Property trainingSpec: Training configuration. |
versionDescription | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property versionDescription: Model version description. |
versionName | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property versionName: The model version, which is unique for each model. |
scopeRequired
- Type: com.aliyun.ros.cdk.core.Construct
idRequired
- Type: java.lang.String
enableResourcePropertyConstraintOptional
- Type: java.lang.Boolean
modelIdRequired
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property modelId: Model ID.
For details about how to obtain the model ID.
uriRequired
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property uri: Model version URI, that is, the location where the model is stored.
Possible values are:
- The HTTP(S) address of the model, for example: 'https://myweb.com/mymodel.tar.gz '.
- If the model is stored in OSS, the format is 'oss://
. /object '. For the endpoint configuration, see Access domain name and data center. For example, see OSS:// mybucket/'.
approvalStatusOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property approvalStatus: Admission status, with values as follows: - Pending: to be determined.
- Approved: Allow to go online.
- Rejected: Online is not allowed.
extraInfoOptional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.Map
Property extraInfo: The additional information.
formatTypeOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property formatType: Model format, possible values: - OfflineModel - SavedModel - Keras H5 - Frozen Pb - Caffe Prototxt - TorchScript - XGBoost - PMML - AlinkModel - ONNX.
frameworkTypeOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property frameworkType: Model framework, possible values: - Pytorch - XGBoost - Keras - Caffe - Alink - Xflow - TensorFlow.
inferenceSpecOptional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.Map
Property inferenceSpec: Describes how to apply to downstream inference services.
For example, describe the processor and container of EAS. Example: { "processor": "tensorflow_gpu_1.12" }
labelsOptional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
LabelsProperty>
Property labels: List of model version labels.
metricsOptional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.Map
Property metrics: The metrics for the model.
The length after serialization is limited to 8,192. Example: { "Results": [{ "Dataset": { "DatasetId": "d-sdkjanksaklerhfd" }, "Metrics": { "cer": 0.175 } }, { "Dataset": { "Uri": "oss://xxxx/" }, "Metrics": { "cer": 0.172 } }] }
optionsOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property options: The extended field.
This is a JSON string.
sourceIdOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property sourceId: Source ID.
- When the source type is Custom, this field is not restricted.
-
When the source is PAIFlow or TrainingService, the format is: region=
,workspaceId= ,kind= ,id= Among them: -
region is the Alibaba Cloud region ID.
- workspaceId indicates the workspace ID.
- kind: is a type. Value: PipelineRun(PAIFlow workflow);ServiceJob (training service).
- id: is a unique identifier.
sourceTypeOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property sourceType: Model source type, possible values: - Custom: Custom.
- PAIFlow:PAI workflow.
- TrainingService:PAI training service.
trainingSpecOptional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.Map
Property trainingSpec: Training configuration.
Configuration for fine-tuning, incremental training.
versionDescriptionOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property versionDescription: Model version description.
versionNameOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property versionName: The model version, which is unique for each model.
If you leave this parameter empty, the first version is 0.1.0 by default. After that, the minor version number is increased by 1 in sequence. For example, the second version number is 0.2.0. A version number consists of a major version number, a minor version number, and a stage version number, separated by periods (.). The major version number and minor version number are numeric. The stage version number begins with a digit and can include numbers, underscores, and letters. For example, the version number is 1.1.0 or 2.3.4_beta.
Methods
| Name | Description |
|---|---|
toString | Returns a string representation of this construct. |
synthesize | Allows this construct to emit artifacts into the cloud assembly during synthesis. |
addCondition | No description. |
addCount | No description. |
addDependency | No description. |
addResourceDesc | No description. |
applyRemovalPolicy | No description. |
fetchCondition | No description. |
fetchDependency | No description. |
fetchResourceDesc | No description. |
getAtt | No description. |
setMetadata | No description. |
toString
public java.lang.String toString()
Returns a string representation of this construct.
synthesize
public void synthesize(ISynthesisSession session)
Allows this construct to emit artifacts into the cloud assembly during synthesis.
This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.
- Type: com.aliyun.ros.cdk.core.ISynthesisSession
The synthesis session.
addCondition
public void addCondition(RosCondition condition)
- Type: com.aliyun.ros.cdk.core.RosCondition
addCount
public void addCount(java.lang.Number OR IResolvable count)
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
addDependency
public void addDependency(Resource resource)
- Type: com.aliyun.ros.cdk.core.Resource
addResourceDesc
public void addResourceDesc(java.lang.String desc)
- Type: java.lang.String
applyRemovalPolicy
public void applyRemovalPolicy(RemovalPolicy policy)
- Type: com.aliyun.ros.cdk.core.RemovalPolicy
fetchCondition
public RosCondition fetchCondition()
fetchDependency
public java.util.List<java.lang.String> fetchDependency()
fetchResourceDesc
public java.lang.String fetchResourceDesc()
getAtt
public IResolvable getAtt(java.lang.String name)
- Type: java.lang.String
setMetadata
public void setMetadata(java.lang.String key, java.lang.Object value)
- Type: java.lang.String
- Type: java.lang.Object
Static Functions
| Name | Description |
|---|---|
isConstruct | Return whether the given object is a Construct. |
isConstruct
import com.aliyun.ros.cdk.pai.ModelVersion;
ModelVersion.isConstruct(java.lang.Object x)
Return whether the given object is a Construct.
- Type: java.lang.Object
Properties
| Name | Type | Description |
|---|---|---|
node | com.aliyun.ros.cdk.core.ConstructNode | The construct tree node associated with this construct. |
env | com.aliyun.ros.cdk.core.IResourceEnvironment | The environment this resource belongs to. |
ref | java.lang.String | No description. |
stack | com.aliyun.ros.cdk.core.Stack | The stack in which this resource is defined. |
resource | com.aliyun.ros.cdk.core.RosResource | No description. |
attrApprovalStatus | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute ApprovalStatus: Admission status, with values as follows:. |
attrExtraInfo | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute ExtraInfo: Other information. |
attrFormatType | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute FormatType: Model format, possible values:. |
attrFrameworkType | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute FrameworkType: Model framework, possible values:. |
attrGmtCreateTime | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute GmtCreateTime: Create a model UTC time in the format ISO8601. |
attrGmtModifiedTime | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute GmtModifiedTime: Finally, update the model UTC time in the format iso8601. |
attrInferenceSpec | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute InferenceSpec: Describes how to apply to downstream inference services, such as processors and containers of EAS. |
attrLabels | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute Labels: List of model version labels. |
attrMetrics | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute Metrics: Model indicators. |
attrOptions | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute Options: Extension field. |
attrOwnerId | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute OwnerId: The Alibaba Cloud account ID. |
attrSourceId | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute SourceId: Source ID. |
attrSourceType | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute SourceType: Model source type, possible values:. |
attrTrainingSpec | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute TrainingSpec: Training configuration. |
attrUri | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute Uri: Model version URI, that is, the location where the model is stored. |
attrUserId | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute UserId: The user ID. |
attrVersionDescription | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute VersionDescription: Model version description. |
attrVersionName | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute VersionName: Model version. |
props | ModelVersionProps | No description. |
nodeRequired
public ConstructNode getNode();
- Type: com.aliyun.ros.cdk.core.ConstructNode
The construct tree node associated with this construct.
envRequired
public IResourceEnvironment getEnv();
- Type: com.aliyun.ros.cdk.core.IResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
refRequired
public java.lang.String getRef();
- Type: java.lang.String
stackRequired
public Stack getStack();
- Type: com.aliyun.ros.cdk.core.Stack
The stack in which this resource is defined.
resourceOptional
public RosResource getResource();
- Type: com.aliyun.ros.cdk.core.RosResource
attrApprovalStatusRequired
public java.lang.Object getAttrApprovalStatus();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute ApprovalStatus: Admission status, with values as follows:.
attrExtraInfoRequired
public java.lang.Object getAttrExtraInfo();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute ExtraInfo: Other information.
attrFormatTypeRequired
public java.lang.Object getAttrFormatType();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute FormatType: Model format, possible values:.
attrFrameworkTypeRequired
public java.lang.Object getAttrFrameworkType();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute FrameworkType: Model framework, possible values:.
attrGmtCreateTimeRequired
public java.lang.Object getAttrGmtCreateTime();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute GmtCreateTime: Create a model UTC time in the format ISO8601.
attrGmtModifiedTimeRequired
public java.lang.Object getAttrGmtModifiedTime();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute GmtModifiedTime: Finally, update the model UTC time in the format iso8601.
attrInferenceSpecRequired
public java.lang.Object getAttrInferenceSpec();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute InferenceSpec: Describes how to apply to downstream inference services, such as processors and containers of EAS.
attrLabelsRequired
public java.lang.Object getAttrLabels();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute Labels: List of model version labels.
attrMetricsRequired
public java.lang.Object getAttrMetrics();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute Metrics: Model indicators.
attrOptionsRequired
public java.lang.Object getAttrOptions();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute Options: Extension field.
The JsonString type.
attrOwnerIdRequired
public java.lang.Object getAttrOwnerId();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute OwnerId: The Alibaba Cloud account ID.
attrSourceIdRequired
public java.lang.Object getAttrSourceId();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute SourceId: Source ID.
attrSourceTypeRequired
public java.lang.Object getAttrSourceType();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute SourceType: Model source type, possible values:.
attrTrainingSpecRequired
public java.lang.Object getAttrTrainingSpec();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute TrainingSpec: Training configuration.
Configuration for fine-tuning, incremental training.
attrUriRequired
public java.lang.Object getAttrUri();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute Uri: Model version URI, that is, the location where the model is stored.
attrUserIdRequired
public java.lang.Object getAttrUserId();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute UserId: The user ID.
attrVersionDescriptionRequired
public java.lang.Object getAttrVersionDescription();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute VersionDescription: Model version description.
attrVersionNameRequired
public java.lang.Object getAttrVersionName();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute VersionName: Model version.
propsRequired
public ModelVersionProps getProps();
- Type: ModelVersionProps