From 21751e0ac5ae01086e94cf68974398c9385a82c0 Mon Sep 17 00:00:00 2001 From: rysmarie Date: Sat, 10 Jun 2017 19:59:30 +0900 Subject: [PATCH 01/15] Make directory --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ca0973 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store + From 273c0838cbe7a1087b6c430a77cffb37da6f840c Mon Sep 17 00:00:00 2001 From: rysmarie Date: Sat, 10 Jun 2017 20:02:07 +0900 Subject: [PATCH 02/15] Add assignment1 --- RyutaShimogauchi/assignment.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 RyutaShimogauchi/assignment.py diff --git a/RyutaShimogauchi/assignment.py b/RyutaShimogauchi/assignment.py new file mode 100644 index 0000000..d32b8df --- /dev/null +++ b/RyutaShimogauchi/assignment.py @@ -0,0 +1,8 @@ +import numpy as np + + +def assignment1(): + listFrom1to10 = list(range(1, 11)) + print('{}'.format(listFrom1to10)) +if __name__ == '__main__': + assignment1() From 8d2c1b6a3a24a968ddfda83eec4541cb0dfece08 Mon Sep 17 00:00:00 2001 From: rysmarie Date: Sat, 10 Jun 2017 20:03:41 +0900 Subject: [PATCH 03/15] Add assgnment2 --- RyutaShimogauchi/assignment.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/RyutaShimogauchi/assignment.py b/RyutaShimogauchi/assignment.py index d32b8df..0e8fe4e 100644 --- a/RyutaShimogauchi/assignment.py +++ b/RyutaShimogauchi/assignment.py @@ -4,5 +4,10 @@ def assignment1(): listFrom1to10 = list(range(1, 11)) print('{}'.format(listFrom1to10)) + +def assignment2(): + evenFrom1to10 = list(range(2, 11, 2)) + print('{}'.format(evenFrom1to10)) if __name__ == '__main__': assignment1() + assignment2() From 504808e0bbbaf5e5133c6576aa5eae4ec073dd54 Mon Sep 17 00:00:00 2001 From: rysmarie Date: Sat, 10 Jun 2017 20:11:48 +0900 Subject: [PATCH 04/15] Add assignment3 --- RyutaShimogauchi/assignment.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/RyutaShimogauchi/assignment.py b/RyutaShimogauchi/assignment.py index 0e8fe4e..f3c4139 100644 --- a/RyutaShimogauchi/assignment.py +++ b/RyutaShimogauchi/assignment.py @@ -5,9 +5,19 @@ def assignment1(): listFrom1to10 = list(range(1, 11)) print('{}'.format(listFrom1to10)) + def assignment2(): evenFrom1to10 = list(range(2, 11, 2)) print('{}'.format(evenFrom1to10)) + + +def assignment3(): + alphabets = ['a', 'b', 'c', 'd', 'e', 'f'] + intAlphDict = {i: alphabets[i] for i in range(len(alphabets))} + print('{}'.format(intAlphDict)) + + if __name__ == '__main__': assignment1() assignment2() + assignment3() From 324a6ed7009ab2a783b44c23f7ee5851508524a6 Mon Sep 17 00:00:00 2001 From: rysmarie Date: Sat, 10 Jun 2017 20:33:38 +0900 Subject: [PATCH 05/15] Add assignment4 --- RyutaShimogauchi/assignment.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/RyutaShimogauchi/assignment.py b/RyutaShimogauchi/assignment.py index f3c4139..730f153 100644 --- a/RyutaShimogauchi/assignment.py +++ b/RyutaShimogauchi/assignment.py @@ -17,7 +17,37 @@ def assignment3(): print('{}'.format(intAlphDict)) +class Human(): + counter = 0 + + def __init__(self, name, age, sex, height, weight): + self.name = name + self.age = age + self.sex = sex + self.height = height + self.weight = weight + self.incrementCounter() + + def incrementAge(self): + self.age += 1 + + def incrementCounter(self): + Human.counter += 1 + + +def assignment4(): + Yamada = Human("山田", 23, "male", 170.3, 60.2) + print('counter value:{}'.format(Human.counter)) + print('{0.name}:\n\tage:{0.age}\n\tsex:{0.sex}\n\theight:{0.height}\n\tweight:{0.weight}\n'.format(Yamada)) + Takahashi = Human("高橋", 30, "female", 165.2, 46.2) + print('counter value:{}'.format(Human.counter)) + print('{0.name}:\n\tage:{0.age}\n\tsex:{0.sex}\n\theight:{0.height}\n\tweight:{0.weight}\n'.format(Takahashi)) + Yamada.incrementAge() + print("increment {}'s age.".format(Yamada.name)) + print('{0.name}:\n\tage:{0.age}\n\tsex:{0.sex}\n\theight:{0.height}\n\tweight:{0.weight}\n'.format(Yamada)) + if __name__ == '__main__': assignment1() assignment2() assignment3() + assignment4() From dcabb1513a98bef6185d919c87d7fb57422d9ffd Mon Sep 17 00:00:00 2001 From: rysmarie Date: Sat, 10 Jun 2017 20:38:49 +0900 Subject: [PATCH 06/15] Add assignment5 --- RyutaShimogauchi/assignment.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/RyutaShimogauchi/assignment.py b/RyutaShimogauchi/assignment.py index 730f153..d2911cf 100644 --- a/RyutaShimogauchi/assignment.py +++ b/RyutaShimogauchi/assignment.py @@ -46,8 +46,16 @@ def assignment4(): print("increment {}'s age.".format(Yamada.name)) print('{0.name}:\n\tage:{0.age}\n\tsex:{0.sex}\n\theight:{0.height}\n\tweight:{0.weight}\n'.format(Yamada)) + +def assignment5(): + A = np.random.randint(0, 10, (3, 3)) + B = np.random.randint(0, 10, (3, 3)) + C = np.matmul(A, B) + print('A={}\nB={}\nA*B=\n{}'.format(A, B, C)) + if __name__ == '__main__': assignment1() assignment2() assignment3() assignment4() + assignment5() From 43f0720b7ce738ac0f7f393ac046da44a24a3c59 Mon Sep 17 00:00:00 2001 From: rysmarie Date: Sat, 10 Jun 2017 20:51:48 +0900 Subject: [PATCH 07/15] Add assignment6 --- RyutaShimogauchi/assignment.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/RyutaShimogauchi/assignment.py b/RyutaShimogauchi/assignment.py index d2911cf..4389046 100644 --- a/RyutaShimogauchi/assignment.py +++ b/RyutaShimogauchi/assignment.py @@ -53,9 +53,18 @@ def assignment5(): C = np.matmul(A, B) print('A={}\nB={}\nA*B=\n{}'.format(A, B, C)) + +def assignment6(): + a = np.random.randint(1, 10, 5) + b = np.random.randint(1, 10, 5) + c = np.dot(a, b) / (np.sqrt(np.sum(a*a)*np.sum(b*b))) + print(np.dot(a, b)) + print('a={}\nb={}\ncos of a and b is {}.'.format(a, b, c)) + if __name__ == '__main__': assignment1() assignment2() assignment3() assignment4() assignment5() + assignment6() From c7ac0872661071914f0eabd0e599b94fe56b3c85 Mon Sep 17 00:00:00 2001 From: rysmarie Date: Sat, 10 Jun 2017 21:03:52 +0900 Subject: [PATCH 08/15] Remove extra line --- RyutaShimogauchi/assignment.py | 1 - 1 file changed, 1 deletion(-) diff --git a/RyutaShimogauchi/assignment.py b/RyutaShimogauchi/assignment.py index 4389046..50073d5 100644 --- a/RyutaShimogauchi/assignment.py +++ b/RyutaShimogauchi/assignment.py @@ -58,7 +58,6 @@ def assignment6(): a = np.random.randint(1, 10, 5) b = np.random.randint(1, 10, 5) c = np.dot(a, b) / (np.sqrt(np.sum(a*a)*np.sum(b*b))) - print(np.dot(a, b)) print('a={}\nb={}\ncos of a and b is {}.'.format(a, b, c)) if __name__ == '__main__': From 2b07a711ee9de0ee3749b286e153b2c253c27998 Mon Sep 17 00:00:00 2001 From: rysmarie Date: Sat, 10 Jun 2017 21:08:43 +0900 Subject: [PATCH 09/15] Add a notebook --- .gitignore | 1 + RyutaShimogauchi/assignment.ipynb | 293 ++++++++++++++++++++++++++++++ 2 files changed, 294 insertions(+) create mode 100644 RyutaShimogauchi/assignment.ipynb diff --git a/.gitignore b/.gitignore index 5ca0973..8aa185a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .DS_Store +.ipynb_checkpoints diff --git a/RyutaShimogauchi/assignment.ipynb b/RyutaShimogauchi/assignment.ipynb new file mode 100644 index 0000000..ca612cc --- /dev/null +++ b/RyutaShimogauchi/assignment.ipynb @@ -0,0 +1,293 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Liaro python_challenge" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 課題1\n", + "1〜10の数字を含むリストを作成する." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "listFrom1to10 = list(range(1, 11))\n", + "listFrom1to10" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 課題2\n", + "1〜10の偶数のみを含むリストを作成する." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[2, 4, 6, 8, 10]" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "evenFrom1to10 = list(range(2, 11, 2))\n", + "evenFrom1to10" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 課題3\n", + "[\"a\",\"b\",\"c\",\"d\",\"e\",\"f\"]というリストがある前提で{0: 'a', 1: 'b', 2: 'c', 3: 'd', 4: 'e', 5: 'f'}を作成する." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "{0: 'a', 1: 'b', 2: 'c', 3: 'd', 4: 'e', 5: 'f'}" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "alphabets = ['a', 'b', 'c', 'd', 'e', 'f']\n", + "intAlphDict = {i: alphabets[i] for i in range(len(alphabets))}\n", + "intAlphDict" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 課題4\n", + "以下のようなHumanクラスを作成する.\n", + "- 属性として名前, 年齢, 性別, 身長, 体重を持つ.\n", + "- 年齢をインクリメントするインスタンスメソッドを持つ.\n", + "- 作成したインスタンスをカウントするクラスメソッドを持つ(インスタンス作成時にカウントするように実装してください).\n", + "\n", + "以下の内容を行う. \n", + "{\"山田\", 23歳, 男, 170.3cm, 60.2kg}, {\"高橋\", 30歳, 女, 165.2cm, 46.2kg}の二つのインスタンスを作成 \n", + "どちらかの年齢をインクリメント" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "counter value:1\n", + "山田:\n", + "\tage:23\n", + "\tsex:male\n", + "\theight:170.3\n", + "\tweight:60.2\n", + "\n", + "counter value:2\n", + "高橋:\n", + "\tage:30\n", + "\tsex:female\n", + "\theight:165.2\n", + "\tweight:46.2\n", + "\n", + "increment 山田's age.\n", + "山田:\n", + "\tage:24\n", + "\tsex:male\n", + "\theight:170.3\n", + "\tweight:60.2\n", + "\n" + ] + } + ], + "source": [ + "class Human():\n", + " counter = 0\n", + "\n", + " def __init__(self, name, age, sex, height, weight):\n", + " self.name = name\n", + " self.age = age\n", + " self.sex = sex\n", + " self.height = height\n", + " self.weight = weight\n", + " self.incrementCounter()\n", + "\n", + " def incrementAge(self):\n", + " self.age += 1\n", + "\n", + " def incrementCounter(self):\n", + " Human.counter += 1\n", + " \n", + "\n", + "Yamada = Human(\"山田\", 23, \"male\", 170.3, 60.2)\n", + "print('counter value:{}'.format(Human.counter))\n", + "print('{0.name}:\\n\\tage:{0.age}\\n\\tsex:{0.sex}\\n\\theight:{0.height}\\n\\tweight:{0.weight}\\n'.format(Yamada))\n", + "Takahashi = Human(\"高橋\", 30, \"female\", 165.2, 46.2)\n", + "print('counter value:{}'.format(Human.counter))\n", + "print('{0.name}:\\n\\tage:{0.age}\\n\\tsex:{0.sex}\\n\\theight:{0.height}\\n\\tweight:{0.weight}\\n'.format(Takahashi))\n", + "Yamada.incrementAge()\n", + "print(\"increment {}'s age.\".format(Yamada.name))\n", + "print('{0.name}:\\n\\tage:{0.age}\\n\\tsex:{0.sex}\\n\\theight:{0.height}\\n\\tweight:{0.weight}\\n'.format(Yamada))\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 課題5\n", + "numpyを用いて自分で自由に作った二つの行列の積を計算する." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import numpy as np" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[100, 44, 123],\n", + " [ 88, 43, 89],\n", + " [ 66, 33, 36]])" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "A = np.random.randint(0, 10, (3, 3))\n", + "B = np.random.randint(0, 10, (3, 3))\n", + "np.matmul(A, B)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 課題6\n", + "numpyを用いて自分で自由に作った二つのベクトルのcosを計算する." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "a=[8 3 5 4 1]\n", + "b=[1 8 7 7 2]\n", + "cos of a and b is 0.6999460685141607.\n" + ] + } + ], + "source": [ + "a = np.random.randint(1, 10, 5)\n", + "b = np.random.randint(1, 10, 5)\n", + "c = np.dot(a, b) / (np.sqrt(np.sum(a*a)*np.sum(b*b)))\n", + "print('a={}\\nb={}\\ncos of a and b is {}.'.format(a, b, c))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "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.5.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} From 57bfdf9c669a0a9c1083f70b74473a66b67d04ee Mon Sep 17 00:00:00 2001 From: rysmarie Date: Sat, 10 Jun 2017 21:10:22 +0900 Subject: [PATCH 10/15] Fix name --- RyutaShimogauchi/{assignment.ipynb => Ryuta_Shimogauchi.ipynb} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename RyutaShimogauchi/{assignment.ipynb => Ryuta_Shimogauchi.ipynb} (100%) diff --git a/RyutaShimogauchi/assignment.ipynb b/RyutaShimogauchi/Ryuta_Shimogauchi.ipynb similarity index 100% rename from RyutaShimogauchi/assignment.ipynb rename to RyutaShimogauchi/Ryuta_Shimogauchi.ipynb From 26c2122824fb28bf4e39e2db81c66b095185c2b4 Mon Sep 17 00:00:00 2001 From: rysmarie Date: Sat, 10 Jun 2017 21:27:07 +0900 Subject: [PATCH 11/15] Add README --- RyutaShimogauchi/README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 RyutaShimogauchi/README.md diff --git a/RyutaShimogauchi/README.md b/RyutaShimogauchi/README.md new file mode 100644 index 0000000..d8041ca --- /dev/null +++ b/RyutaShimogauchi/README.md @@ -0,0 +1,22 @@ +# python\_challenge +python\_challengeの実装です. + +## Introduction +###名前 +下垣内 隆太 + +###大学名 +東京大学 + +###専攻 +工学部電子情報工学科 + +### 今までの開発経験 +あまりgithubには上げていませんが[自分のアカウント](https://github.com/rysmarie?tab=repositories)を見てください. +高専に在籍していたときの卒研で作成したプログラムが[このリポジトリ](https://github.com/kcct-fujimotolab/3DCNN)に上がっています. +ディープラーニングのライブラリ・フレームワークはTensorFlow, Chainer, Kerasを使ったことがあります. + +### 中間的な目標 +インターンシップに参加し, 自分がどの程度できるのかを確かめることが現段階での目標です. +また, 論文をもっと読み実装することも目標としており, 確率統計や英語の勉強をしています. + From fae95a88731ba017778dec0b4f1d5a1b8a6bb379 Mon Sep 17 00:00:00 2001 From: rysmarie Date: Sat, 10 Jun 2017 23:26:34 +0900 Subject: [PATCH 12/15] Fix to faster way to calculate cos --- RyutaShimogauchi/Ryuta_Shimogauchi.ipynb | 36 ++++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/RyutaShimogauchi/Ryuta_Shimogauchi.ipynb b/RyutaShimogauchi/Ryuta_Shimogauchi.ipynb index ca612cc..233259e 100644 --- a/RyutaShimogauchi/Ryuta_Shimogauchi.ipynb +++ b/RyutaShimogauchi/Ryuta_Shimogauchi.ipynb @@ -17,7 +17,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": { "collapsed": false }, @@ -28,7 +28,7 @@ "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]" ] }, - "execution_count": 1, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -48,7 +48,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": { "collapsed": false }, @@ -59,7 +59,7 @@ "[2, 4, 6, 8, 10]" ] }, - "execution_count": 2, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -79,7 +79,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": { "collapsed": false }, @@ -90,7 +90,7 @@ "{0: 'a', 1: 'b', 2: 'c', 3: 'd', 4: 'e', 5: 'f'}" ] }, - "execution_count": 3, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -118,7 +118,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": { "collapsed": false }, @@ -191,7 +191,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": { "collapsed": true }, @@ -202,7 +202,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": { "collapsed": false }, @@ -210,12 +210,12 @@ { "data": { "text/plain": [ - "array([[100, 44, 123],\n", - " [ 88, 43, 89],\n", - " [ 66, 33, 36]])" + "array([[57, 19, 96],\n", + " [54, 12, 72],\n", + " [18, 18, 78]])" ] }, - "execution_count": 6, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -236,7 +236,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": { "collapsed": false }, @@ -245,16 +245,16 @@ "name": "stdout", "output_type": "stream", "text": [ - "a=[8 3 5 4 1]\n", - "b=[1 8 7 7 2]\n", - "cos of a and b is 0.6999460685141607.\n" + "a=[3 8 1 6 8]\n", + "b=[7 3 4 7 3]\n", + "cos of a and b is 0.7588155998621918.\n" ] } ], "source": [ "a = np.random.randint(1, 10, 5)\n", "b = np.random.randint(1, 10, 5)\n", - "c = np.dot(a, b) / (np.sqrt(np.sum(a*a)*np.sum(b*b)))\n", + "c = np.dot(a, b) / (np.linalg.norm(a)*np.linalg.norm(b))\n", "print('a={}\\nb={}\\ncos of a and b is {}.'.format(a, b, c))" ] }, From 44e0bf5a0d86970c194a57877d5c8b5931389280 Mon Sep 17 00:00:00 2001 From: rysmarie Date: Sat, 10 Jun 2017 23:27:54 +0900 Subject: [PATCH 13/15] Apply fix to assignment.py --- RyutaShimogauchi/assignment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RyutaShimogauchi/assignment.py b/RyutaShimogauchi/assignment.py index 50073d5..8bcdc2e 100644 --- a/RyutaShimogauchi/assignment.py +++ b/RyutaShimogauchi/assignment.py @@ -57,7 +57,7 @@ def assignment5(): def assignment6(): a = np.random.randint(1, 10, 5) b = np.random.randint(1, 10, 5) - c = np.dot(a, b) / (np.sqrt(np.sum(a*a)*np.sum(b*b))) + c = np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b)) print('a={}\nb={}\ncos of a and b is {}.'.format(a, b, c)) if __name__ == '__main__': From 6cbc5c76b2900b25287fe736e383ddae19e4b728 Mon Sep 17 00:00:00 2001 From: rysmarie Date: Sat, 10 Jun 2017 23:35:17 +0900 Subject: [PATCH 14/15] Using less function --- RyutaShimogauchi/Ryuta_Shimogauchi.ipynb | 112 +++-------------------- RyutaShimogauchi/assignment.py | 2 +- 2 files changed, 15 insertions(+), 99 deletions(-) diff --git a/RyutaShimogauchi/Ryuta_Shimogauchi.ipynb b/RyutaShimogauchi/Ryuta_Shimogauchi.ipynb index 233259e..89ccef1 100644 --- a/RyutaShimogauchi/Ryuta_Shimogauchi.ipynb +++ b/RyutaShimogauchi/Ryuta_Shimogauchi.ipynb @@ -17,22 +17,11 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]" - ] - }, - "execution_count": 2, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "listFrom1to10 = list(range(1, 11))\n", "listFrom1to10" @@ -48,22 +37,11 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "[2, 4, 6, 8, 10]" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "evenFrom1to10 = list(range(2, 11, 2))\n", "evenFrom1to10" @@ -79,25 +57,14 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "{0: 'a', 1: 'b', 2: 'c', 3: 'd', 4: 'e', 5: 'f'}" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "alphabets = ['a', 'b', 'c', 'd', 'e', 'f']\n", - "intAlphDict = {i: alphabets[i] for i in range(len(alphabets))}\n", + "intAlphDict = {i: a for i, a in enumerate(alphabets)}\n", "intAlphDict" ] }, @@ -118,39 +85,11 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "counter value:1\n", - "山田:\n", - "\tage:23\n", - "\tsex:male\n", - "\theight:170.3\n", - "\tweight:60.2\n", - "\n", - "counter value:2\n", - "高橋:\n", - "\tage:30\n", - "\tsex:female\n", - "\theight:165.2\n", - "\tweight:46.2\n", - "\n", - "increment 山田's age.\n", - "山田:\n", - "\tage:24\n", - "\tsex:male\n", - "\theight:170.3\n", - "\tweight:60.2\n", - "\n" - ] - } - ], + "outputs": [], "source": [ "class Human():\n", " counter = 0\n", @@ -191,7 +130,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": { "collapsed": true }, @@ -202,24 +141,11 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[57, 19, 96],\n", - " [54, 12, 72],\n", - " [18, 18, 78]])" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "A = np.random.randint(0, 10, (3, 3))\n", "B = np.random.randint(0, 10, (3, 3))\n", @@ -236,21 +162,11 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "a=[3 8 1 6 8]\n", - "b=[7 3 4 7 3]\n", - "cos of a and b is 0.7588155998621918.\n" - ] - } - ], + "outputs": [], "source": [ "a = np.random.randint(1, 10, 5)\n", "b = np.random.randint(1, 10, 5)\n", diff --git a/RyutaShimogauchi/assignment.py b/RyutaShimogauchi/assignment.py index 8bcdc2e..4580317 100644 --- a/RyutaShimogauchi/assignment.py +++ b/RyutaShimogauchi/assignment.py @@ -13,7 +13,7 @@ def assignment2(): def assignment3(): alphabets = ['a', 'b', 'c', 'd', 'e', 'f'] - intAlphDict = {i: alphabets[i] for i in range(len(alphabets))} + intAlphDict = {i: a for i, a in enumerate(alphabets)} print('{}'.format(intAlphDict)) From 10cdf61187605661f85a7430c63f0a4a2cd84d80 Mon Sep 17 00:00:00 2001 From: rysmarie Date: Sat, 10 Jun 2017 23:47:12 +0900 Subject: [PATCH 15/15] Show results of the notebook --- RyutaShimogauchi/README.md | 2 +- RyutaShimogauchi/Ryuta_Shimogauchi.ipynb | 110 ++++++++++++++++++++--- 2 files changed, 98 insertions(+), 14 deletions(-) diff --git a/RyutaShimogauchi/README.md b/RyutaShimogauchi/README.md index d8041ca..16f35c7 100644 --- a/RyutaShimogauchi/README.md +++ b/RyutaShimogauchi/README.md @@ -14,7 +14,7 @@ python\_challengeの実装です. ### 今までの開発経験 あまりgithubには上げていませんが[自分のアカウント](https://github.com/rysmarie?tab=repositories)を見てください. 高専に在籍していたときの卒研で作成したプログラムが[このリポジトリ](https://github.com/kcct-fujimotolab/3DCNN)に上がっています. -ディープラーニングのライブラリ・フレームワークはTensorFlow, Chainer, Kerasを使ったことがあります. +ディープラーニングのライブラリ・フレームワークはTensorFlow, Chainer, Kerasを使ったことがあります. ### 中間的な目標 インターンシップに参加し, 自分がどの程度できるのかを確かめることが現段階での目標です. diff --git a/RyutaShimogauchi/Ryuta_Shimogauchi.ipynb b/RyutaShimogauchi/Ryuta_Shimogauchi.ipynb index 89ccef1..8cc2258 100644 --- a/RyutaShimogauchi/Ryuta_Shimogauchi.ipynb +++ b/RyutaShimogauchi/Ryuta_Shimogauchi.ipynb @@ -17,11 +17,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": { "collapsed": false }, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "listFrom1to10 = list(range(1, 11))\n", "listFrom1to10" @@ -37,11 +48,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": { "collapsed": false }, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "[2, 4, 6, 8, 10]" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "evenFrom1to10 = list(range(2, 11, 2))\n", "evenFrom1to10" @@ -57,11 +79,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": { "collapsed": false }, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "{0: 'a', 1: 'b', 2: 'c', 3: 'd', 4: 'e', 5: 'f'}" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "alphabets = ['a', 'b', 'c', 'd', 'e', 'f']\n", "intAlphDict = {i: a for i, a in enumerate(alphabets)}\n", @@ -85,11 +118,39 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": { "collapsed": false }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "counter value:1\n", + "山田:\n", + "\tage:23\n", + "\tsex:male\n", + "\theight:170.3\n", + "\tweight:60.2\n", + "\n", + "counter value:2\n", + "高橋:\n", + "\tage:30\n", + "\tsex:female\n", + "\theight:165.2\n", + "\tweight:46.2\n", + "\n", + "increment 山田's age.\n", + "山田:\n", + "\tage:24\n", + "\tsex:male\n", + "\theight:170.3\n", + "\tweight:60.2\n", + "\n" + ] + } + ], "source": [ "class Human():\n", " counter = 0\n", @@ -130,7 +191,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": { "collapsed": true }, @@ -141,11 +202,24 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": { "collapsed": false }, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "array([[19, 7, 91],\n", + " [ 8, 57, 50],\n", + " [15, 45, 87]])" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "A = np.random.randint(0, 10, (3, 3))\n", "B = np.random.randint(0, 10, (3, 3))\n", @@ -162,11 +236,21 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": { "collapsed": false }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "a=[8 2 3 5 5]\n", + "b=[2 4 4 3 6]\n", + "cos of a and b is 0.7986208584745025.\n" + ] + } + ], "source": [ "a = np.random.randint(1, 10, 5)\n", "b = np.random.randint(1, 10, 5)\n",