Skip to content

Commit 4ed3f07

Browse files
committed
update samples - test
1 parent 46ec74f commit 4ed3f07

File tree

308 files changed

+13799
-59323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

308 files changed

+13799
-59323
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ Read more detailed instructions on [how to set up your environment](./NBSETUP.md
1313

1414
## How to navigate and use the example notebooks?
1515
If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, you should always run the [Configuration](./configuration.ipynb) notebook first when setting up a notebook library on a new machine or in a new environment. It configures your notebook library to connect to an Azure Machine Learning workspace, and sets up your workspace and compute to be used by many of the other examples.
16+
This [index](.index.md) should assist in navigating the Azure Machine Learning notebook samples and encourage efficient retrieval of topics and content.
1617

1718
If you want to...
1819

1920
* ...try out and explore Azure ML, start with image classification tutorials: [Part 1 (Training)](./tutorials/img-classification-part1-training.ipynb) and [Part 2 (Deployment)](./tutorials/img-classification-part2-deploy.ipynb).
20-
* ...prepare your data and do automated machine learning, start with regression tutorials: [Part 1 (Data Prep)](./tutorials/regression-part1-data-prep.ipynb) and [Part 2 (Automated ML)](./tutorials/regression-part2-automated-ml.ipynb).
2121
* ...learn about experimentation and tracking run history, first [train within Notebook](./how-to-use-azureml/training/train-within-notebook/train-within-notebook.ipynb), then try [training on remote VM](./how-to-use-azureml/training/train-on-remote-vm/train-on-remote-vm.ipynb) and [using logging APIs](./how-to-use-azureml/training/logging-api/logging-api.ipynb).
2222
* ...train deep learning models at scale, first learn about [Machine Learning Compute](./how-to-use-azureml/training/train-on-amlcompute/train-on-amlcompute.ipynb), and then try [distributed hyperparameter tuning](./how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-pytorch/train-hyperparameter-tune-deploy-with-pytorch.ipynb) and [distributed training](./how-to-use-azureml/training-with-deep-learning/distributed-pytorch-with-horovod/distributed-pytorch-with-horovod.ipynb).
2323
* ...deploy models as a realtime scoring service, first learn the basics by [training within Notebook and deploying to Azure Container Instance](./how-to-use-azureml/training/train-within-notebook/train-within-notebook.ipynb), then learn how to [register and manage models, and create Docker images](./how-to-use-azureml/deployment/register-model-create-image-deploy-service/register-model-create-image-deploy-service.ipynb), and [production deploy models on Azure Kubernetes Cluster](./how-to-use-azureml/deployment/production-deploy-to-aks/production-deploy-to-aks.ipynb).
2424
* ...deploy models as a batch scoring service, first [train a model within Notebook](./how-to-use-azureml/training/train-within-notebook/train-within-notebook.ipynb), learn how to [register and manage models](./how-to-use-azureml/deployment/register-model-create-image-deploy-service/register-model-create-image-deploy-service.ipynb), then [create Machine Learning Compute for scoring compute](./how-to-use-azureml/training/train-on-amlcompute/train-on-amlcompute.ipynb), and [use Machine Learning Pipelines to deploy your model](https://aka.ms/pl-batch-scoring).
25-
* ...monitor your deployed models, learn about using [App Insights](./how-to-use-azureml/deployment/enable-app-insights-in-production-service/enable-app-insights-in-production-service.ipynb) and [model data collection](./how-to-use-azureml/deployment/enable-data-collection-for-models-in-aks/enable-data-collection-for-models-in-aks.ipynb).
25+
* ...monitor your deployed models, learn about using [App Insights](./how-to-use-azureml/deployment/enable-app-insights-in-production-service/enable-app-insights-in-production-service.ipynb).
2626

2727
## Tutorials
2828

configuration.ipynb

+7-3
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"source": [
104104
"import azureml.core\n",
105105
"\n",
106-
"print(\"This notebook was created using version 1.0.69 of the Azure ML SDK\")\n",
106+
"print(\"This notebook was created using version 1.0.72 of the Azure ML SDK\")\n",
107107
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
108108
]
109109
},
@@ -214,7 +214,10 @@
214214
"* You do not have permission to create a resource group if it's non-existing.\n",
215215
"* You are not a subscription owner or contributor and no Azure ML workspaces have ever been created in this subscription\n",
216216
"\n",
217-
"If workspace creation fails, please work with your IT admin to provide you with the appropriate permissions or to provision the required resources."
217+
"If workspace creation fails, please work with your IT admin to provide you with the appropriate permissions or to provision the required resources.\n",
218+
"\n",
219+
"**Note**: A Basic workspace is created by default. If you would like to create an Enterprise workspace, please specify sku = 'enterprise'.\n",
220+
"Please visit our [pricing page](https://azure.microsoft.com/en-us/pricing/details/machine-learning/) for more details on our Enterprise edition.\n"
218221
]
219222
},
220223
{
@@ -235,6 +238,7 @@
235238
" resource_group = resource_group, \n",
236239
" location = workspace_region,\n",
237240
" create_resource_group = True,\n",
241+
" sku = 'basic',\n",
238242
" exist_ok = True)\n",
239243
"ws.get_details()\n",
240244
"\n",
@@ -357,7 +361,7 @@
357361
"metadata": {
358362
"authors": [
359363
{
360-
"name": "roastala"
364+
"name": "ninhu"
361365
}
362366
],
363367
"kernelspec": {

contrib/RAPIDS/rapids.yml

-48
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
# Copyright (c) Microsoft. All rights reserved.
3+
# Licensed under the MIT license.
4+
5+
import os
6+
import numpy as np
7+
import tensorflow as tf
8+
from PIL import Image
9+
from azureml.core import Model
10+
11+
12+
def init():
13+
global g_tf_sess
14+
15+
# pull down model from workspace
16+
model_path = Model.get_model_path("mnist")
17+
18+
# contruct graph to execute
19+
tf.reset_default_graph()
20+
saver = tf.train.import_meta_graph(os.path.join(model_path, 'mnist-tf.model.meta'))
21+
g_tf_sess = tf.Session(config=tf.ConfigProto(device_count={'GPU': 0}))
22+
saver.restore(g_tf_sess, os.path.join(model_path, 'mnist-tf.model'))
23+
24+
25+
def run(mini_batch):
26+
print(f'run method start: {__file__}, run({mini_batch})')
27+
resultList = []
28+
in_tensor = g_tf_sess.graph.get_tensor_by_name("network/X:0")
29+
output = g_tf_sess.graph.get_tensor_by_name("network/output/MatMul:0")
30+
31+
for image in mini_batch:
32+
# prepare each image
33+
data = Image.open(image)
34+
np_im = np.array(data).reshape((1, 784))
35+
# perform inference
36+
inference_result = output.eval(feed_dict={in_tensor: np_im}, session=g_tf_sess)
37+
# find best probability, and add to result list
38+
best_result = np.argmax(inference_result)
39+
resultList.append("{}: {}".format(os.path.basename(image), best_result))
40+
41+
return resultList
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import io
2+
import pickle
3+
import argparse
4+
import numpy as np
5+
6+
from azureml.core.model import Model
7+
from sklearn.linear_model import LogisticRegression
8+
9+
10+
def init():
11+
global iris_model
12+
13+
parser = argparse.ArgumentParser(description="Iris model serving")
14+
parser.add_argument('--model_name', dest="model_name", required=True)
15+
args, unknown_args = parser.parse_known_args()
16+
17+
model_path = Model.get_model_path(args.model_name)
18+
with open(model_path, 'rb') as model_file:
19+
iris_model = pickle.load(model_file)
20+
21+
22+
def run(input_data):
23+
# make inference
24+
num_rows, num_cols = input_data.shape
25+
pred = iris_model.predict(input_data).reshape((num_rows, 1))
26+
27+
# cleanup output
28+
result = input_data.drop(input_data.columns[4:], axis=1)
29+
result['variety'] = pred
30+
31+
return result

0 commit comments

Comments
 (0)