Megosztás a következőn keresztül:


ResourceConfiguration Osztály

Meghatározza az Azure Machine Learning-erőforrások erőforrás-konfigurációjának részleteit.

Inicializálja a ResourceConfiguration paramétert.

Öröklődés
builtins.object
ResourceConfiguration

Konstruktor

ResourceConfiguration(cpu=None, memory_in_gb=None, gpu=None)

Paraméterek

cpu
float
alapértelmezett érték: None

Az erőforráshoz lefoglalandó CPU-magok száma. Tizedes tört is lehet.

memory_in_gb
float
alapértelmezett érték: None

Az erőforráshoz lefoglalandó memória mennyisége (GB-ban). Tizedes tört is lehet.

gpu
int
alapértelmezett érték: None

Az erőforráshoz lefoglalandó GPU-k száma.

cpu
float
Kötelező

Az erőforráshoz lefoglalandó CPU-magok száma. Tizedes tört is lehet.

memory_in_gb
float
Kötelező

Az erőforráshoz lefoglalandó memória mennyisége (GB-ban). Tizedes tört is lehet.

gpu
int
Kötelező

Az erőforráshoz lefoglalandó GPU-k száma.

Megjegyzések

Inicializáljon egy erőforrás-konfigurációt ezzel az osztálysal. Az alábbi kód például bemutatja, hogyan regisztrálhat egy keretrendszert, bemeneti és kimeneti adatkészleteket, valamint erőforrás-konfigurációt meghatározó modellt.


   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)

Metódusok

deserialize

JSON-objektum konvertálása ResourceConfiguration objektummá.

serialize

Konvertálja ezt a ResourceConfiguration-t szerializált JSON-szótárlá.

deserialize

JSON-objektum konvertálása ResourceConfiguration objektummá.

static deserialize(payload_obj)

Paraméterek

payload_obj
dict
Kötelező

A ResourceConfiguration objektummá konvertálandó JSON-objektum.

Válaszok

A megadott JSON-objektum ResourceConfiguration ábrázolása.

Visszatérési típus

serialize

Konvertálja ezt a ResourceConfiguration-t szerializált JSON-szótárlá.

serialize()

Válaszok

A ResourceConfiguration JSON-reprezentációja.

Visszatérési típus