Skip to content

Commit

Permalink
Prepare for DAIL03
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoHoo committed Oct 24, 2018
1 parent 9112cbb commit 440b5e5
Show file tree
Hide file tree
Showing 12 changed files with 12,335 additions and 11,831 deletions.
Binary file added .DS_Store
Binary file not shown.
6 changes: 6 additions & 0 deletions .ipynb_checkpoints/Untitled-checkpoint.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 2
}
152 changes: 152 additions & 0 deletions .ipynb_checkpoints/hol-ai-checkpoint.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Tech"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import pandas as pd\n",
"import requests\n",
"import io\n",
"url=\"https://raw.githubusercontent.com/HaoHoo/HOL-AI/master/data/MNIST Test 10k 28x28 dense.csv\"\n",
"stream=requests.get(url).content\n",
"frame=pd.read_csv(io.StringIO(stream.decode('utf-8')), sep='\\t', header=0)\n",
"frame"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"data_np_array=frame.values\n",
"print(data_np_array)\n",
"print(data_np_array.shape)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"select_img_array=data_np_array[999,1:]\n",
"print(select_img_array)\n",
"print(select_img_array.shape)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"img_data=select_img_array.reshape((28,28))\n",
"print(img_data)\n",
"print(img_data.shape)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline\n",
"plt.gray()\n",
"plt.imshow(img_data)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"arrdat=np.loadtxt(\"https://raw.githubusercontent.com/HaoHoo/HOL-AI/master/data/HOL_MNIST_test.csv\", 'i2', delimiter=\",\")\n",
"imgdat=arrdat.reshape(10,28,28)\n",
"fig, axs = plt.subplots(2, 5)\n",
"fig.subplots_adjust(left=0.06, right=0.68, top=0.42, bottom=0.06, hspace=0.1, wspace=0)\n",
"images = []\n",
"k=0\n",
"for i in range(2):\n",
" for j in range(5):\n",
" images.append(axs[i,j].imshow(imgdat[k,]))\n",
" axs[i,j].set_xticklabels('')\n",
" axs[i,j].set_yticklabels('')\n",
" axs[i,j].set_xticks([0,13,27])\n",
" axs[i,j].set_yticks([0,13,27])\n",
" k=k+1 \n",
"axs[1,0].set_xticklabels((0,13,27))\n",
"axs[1,0].set_yticklabels((27,13,0))\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from azureml import Workspace\n",
"ws = Workspace(\n",
" workspace_id='0bbb5768107c4bc5a688ad6f5d865259',\n",
" authorization_token='iX2G/38shEF1b3FBw9Kw3F1rqsfVsBAezskvc2NHn1bXGLbUL2mtdlmIFA0CVPifdfRHbV4AKCkfqrWlWFVNAQ==',\n",
" endpoint='https://studioapi.azureml.net'\n",
")\n",
"ds = ws.datasets['MNIST Test 10k 28x28 dense']\n",
"fm = ds.to_dataframe()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fm"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading

0 comments on commit 440b5e5

Please sign in to comment.