らんだむな記憶

blogというものを体験してみようか!的なー

Deep Learning (ud730)

ぴっくるー - らんだむな記憶で少し触って放置していたやつ。

機械学習のオンライン講座 - らんだむな記憶で引用したDeep Learning | UdacityもColaboratoryで実行できるかなと思ったので再度動画を見てみる。なんかipynbへのリンクが切れているけど、examples/courses/udacity_deep_learning at master · tensorflow/examples · GitHubに移動したらしい。
ipynbをGoogle Driveに突っ込んんでColaboratoryで開いたら普通に使えるようだった。ポチポチすることで必要なファイルも仮想マシンにダウンロードしてくれる。これでローカルマシンに妙な負担をしいなくて済む・・・。

あぁ、でもよく見ると

Warning: These files DEPRECATED. see https://tensorflow.org/tutorials for modern examples of how to use tensorflow.

Course information can be found at https://www.udacity.com/course/deep-learning--ud730

となっていて、ud730はもう古いみたいだ・・・。リンクを踏んでもud187「Intro to TensorFlow for Deep Learning」に飛ばされる・・・。
2019/12/30時点ではコンテンツが消えているかも。https://www.youtube.com/watch?v=iF8dRePlPUo&list=PLAwxTw4SYaPn_OWPFT9ulXLuQrImzHfOVから動画くらいは見られるかも。*1

まぁ、それはさておき「1_notmnist.ipynb」のProblem 1「Let's take a peek at some of the data to make sure it looks sensible.」は以下のような感じで:

from IPython.display import Image, display_png
import glob

for i, png_file in enumerate(glob.glob('./notMNIST_large/A/*.png')):
    if i >= 3:
        break
    display_png(Image(png_file))

Problem 2はレクチャーの通りに

import matplotlib.pyplot as plt

pickle_file = train_datasets[0]  # index 0 should be all As, 1 = all Bs, etc.
with open(pickle_file, 'rb') as f:
    letter_set = pickle.load(f)  # unpickle
    sample_idx = np.random.randint(len(letter_set))  # pick a random image index
    sample_image = letter_set[sample_idx, :, :]  # extract a 2D slice
    plt.figure()
    plt.imshow(sample_image)  # display it

などで。

*1:登録済みならhttps://classroom.udacity.com/courses/ud730から見られるかも?