ResourceConfiguration Class
Defines the details for the resource configuration of Azure Machine Learning resources.
Initialize the ResourceConfiguration.
- Inheritance
-
builtins.objectResourceConfiguration
Constructor
ResourceConfiguration(cpu=None, memory_in_gb=None, gpu=None)
Parameters
- cpu
- float
The number of CPU cores to allocate for this resource. Can be a decimal.
- memory_in_gb
- float
The amount of memory (in GB) to allocate for this resource. Can be a decimal.
- memory_in_gb
- float
The amount of memory (in GB) to allocate for this resource. Can be a decimal.
Remarks
Initialize a resource configuration with this class. For example, the following code shows how to register a model specifying framework, input and output datasets, and resource configuration.
import sklearn
from azureml.core import Model
from azureml.core.resource_configuration import ResourceConfiguration
model = Model.register(workspace=ws,
model_name='my-sklearn-model', # Name of the registered model in your workspace.
model_path='./sklearn_regression_model.pkl', # Local file to upload and register as a model.
model_framework=Model.Framework.SCIKITLEARN, # Framework used to create the model.
model_framework_version=sklearn.__version__, # Version of scikit-learn used to create the model.
sample_input_dataset=input_dataset,
sample_output_dataset=output_dataset,
resource_configuration=ResourceConfiguration(cpu=1, memory_in_gb=0.5),
description='Ridge regression model to predict diabetes progression.',
tags={'area': 'diabetes', 'type': 'regression'})
print('Name:', model.name)
print('Version:', model.version)
Methods
deserialize |
Convert a JSON object into a ResourceConfiguration object. |
serialize |
Convert this ResourceConfiguration into a JSON serialized dictionary. |
deserialize
Convert a JSON object into a ResourceConfiguration object.
static deserialize(payload_obj)
Parameters
Returns
The ResourceConfiguration representation of the provided JSON object.
Return type
serialize
Convert this ResourceConfiguration into a JSON serialized dictionary.
serialize()
Returns
The JSON representation of this ResourceConfiguration.
Return type
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for