๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

Machine Learning/Azure ML

Azure ML ์ˆœ์„œ

๋ฐ˜์‘ํ˜•

1. Azure ML ์ž‘์—… ์˜์—ญํ•˜๊ณ  ์—ฐ๊ฒฐ

import azureml.core
from azureml.core import Workspace

# check core SDK version number
print("Azure ML SDK Version: ", azureml.core.VERSION)

# load workspace configuration from the config.json file in the current folder.
ws = Workspace.from_config()
print(ws.name, ws.location, ws.resource_group, ws.location, sep = '\t')

 

2. ์‹คํ—˜ ๋งŒ๋“ฌ - ๋ถˆ๋Ÿฌ์˜จ ์ž‘์—…์˜์—ญ ws์— ์‹คํ—˜ ์ด๋ฆ„ ์ •ํ•˜๊ณ  ๋งŒ๋“ฌ

experiment_name = 'sklearn-mnist'

from azureml.core import Experiment
exp = Experiment(workspace=ws, name=experiment_name)

 

3. AML ์ปดํ“จํŒ… ๋งŒ๋“ค๊ธฐ or ์—ฐ๊ฒฐ

- ์ปดํ“จํŒ… ์‚ฌ์šฉ : Azure ๊ฐ€์ƒ๋จธ์‹  ํด๋Ÿฌ์Šคํ„ฐ์—์„œ ๊ธฐ๊ณ„ํ•™์Šต ๋ชจ๋ธ ํ•™์Šต ๊ฐ€๋Šฅ (ex) GPU์ง€์›๋˜๋Š” VM ์žˆ์Œ

- ์ปดํ“จํŒ… ๋งŒ๋“œ๋Š”๋ฐ ์•ฝ 5๋ถ„ ์†Œ์š”๋จ.

from azureml.core.compute import AmlCompute
from azureml.core.compute import ComputeTarget
import os

# choose a name for your cluster
compute_name = os.environ.get("AML_COMPUTE_CLUSTER_NAME", "cpucluster")
compute_min_nodes = os.environ.get("AML_COMPUTE_CLUSTER_MIN_NODES", 0)
compute_max_nodes = os.environ.get("AML_COMPUTE_CLUSTER_MAX_NODES", 4)

# This example uses CPU VM. For using GPU VM, set SKU to STANDARD_NC6
vm_size = os.environ.get("AML_COMPUTE_CLUSTER_SKU", "STANDARD_D2_V2")


if compute_name in ws.compute_targets:
    compute_target = ws.compute_targets[compute_name]
    if compute_target and type(compute_target) is AmlCompute:
        print('found compute target. just use it. ' + compute_name)
else:
    print('creating a new compute target...')
    provisioning_config = AmlCompute.provisioning_configuration(vm_size = vm_size,
                                                                min_nodes = compute_min_nodes, 
                                                                max_nodes = compute_max_nodes)

    # create the cluster
    compute_target = ComputeTarget.create(ws, compute_name, provisioning_config)
    
    # can poll for a minimum number of nodes and for a specific timeout. 
    # if no min node count is provided it will use the scale settings for the cluster
    compute_target.wait_for_completion(show_output=True, min_node_count=None, timeout_in_minutes=20)
    
     # For a more detailed view of current AmlCompute status, use get_status()
    print(compute_target.get_status().serialize())

 

4. ํด๋ผ์šฐ๋“œ์— ๋ฐ์ดํ„ฐ ์—…๋กœ๋“œ

ds = ws.get_default_datastore()
print(ds.datastore_type, ds.account_name, ds.container_name)

ds.upload(src_dir=data_folder, target_path='mnist', overwrite=True, show_progress=True)

 

5. ์›๊ฒฉ ํด๋Ÿฌ์Šคํ„ฐ์—์„œ ํ•™์Šต

6. ์›๊ฒฉ ์‹คํ–‰ ๋ชจ๋‹ˆํ„ฐ๋ง

7. ๋ชจ๋ธ ๋“ฑ๋ก

 

https://docs.microsoft.com/ko-kr/azure/machine-learning/service/tutorial-train-models-with-aml

 

์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜ ์ž์Šต์„œ: ๋ชจ๋ธ ํ•™์Šต - Azure Machine Learning service

Azure Machine Learning Service๋ฅผ ์‚ฌ์šฉํ•˜๋Š” Python Jupyter Notebook์—์„œ scikit-Learn์„ ์‚ฌ์šฉํ•˜์—ฌ ์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜ ๋ชจ๋ธ์„ ํ•™์Šต์‹œํ‚ค๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ์•„๋ด…๋‹ˆ๋‹ค. ์ด ์ž์Šต์„œ๋Š” 2๋ถ€๋กœ ๊ตฌ์„ฑ๋œ ์‹œ๋ฆฌ์ฆˆ ์ค‘ ์ œ1๋ถ€์ž…๋‹ˆ๋‹ค.

docs.microsoft.com

๋ฐ˜์‘ํ˜•

'Machine Learning > Azure ML' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

๋ฐ์ดํ„ฐ ๋กœ๋“œ  (0) 2019.07.22
AKS ํด๋Ÿฌ์Šคํ„ฐ ๋งŒ๋“ค๊ธฐ  (0) 2019.06.25
Azure Machine Learning  (0) 2019.05.15