• Stars
    star
    140
  • Rank 260,834 (Top 6 %)
  • Language
    Python
  • Created over 6 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

『直感 Deep Learning』のリポジトリ

直感 Deep Learning


表紙


本リポジトリはオライリー・ジャパン発行書籍『直感 Deep Learning』(原書名『Deep Learning with Keras』)のサポートサイトです。

サンプルコード

ファイル構成

フォルダ名 説明
ch01 1章で使用するソースコードとライブラリ導入に必要なrequirements.txt
ch02 2章で使用するソースコードとライブラリ導入に必要なrequirements.txt
... ...
ch08 8章で使用するソースコードとライブラリ導入に必要なrequirements.txt

サンプルコードの解説は本書籍をご覧ください。

仮想環境の準備

環境構築の方法は読者に任せていますが、一般的には仮想環境を構築する方法を推奨されるのでその方法を記述しておきます。

pyenvvirtualenvの導入をします。

linux

apt-get install pyenv
apt-get install virtualenv

Mac

brew install pyenv
brew install virtualenv

pyenvvirtualenvを用いて仮想環境を構築します。

pyenv install 3.6.0
pyenv rehash
pyenv local 3.6.0
virtualenv -p ~/.pyenv/versions/3.6.0/bin/python3.6 my_env
source my_env/bin/activate

Windows

Anacondaを導入して下さい。

使用方法

サンプルを実行する前に、必要なライブラリをインストールする必要があります。

$ pip install -r requirements.txt

CPU用のrequirements.txtとGPU用のrequirements_gpu.txtを章ごとに用意してあります。

巻末の付録Aで、GPUを考慮した開発環境の構築について補足していますので参考にしてください。

各章のフォルダへ移動して、Pythonコマンドを実行します。書籍にどのpythonコードを動作させているか明記しています。

下記は一例です。

cd ch03
python cifar10_deep_with_aug.py

実行環境

日本語版で検証に使用した各ソフトウェアのバージョン、およびハードウェアは次のとおりです。

ソフトウェア

  • Pycharm-community-2017.1
  • Python 3.6.0(10章ではDocker環境での簡易的な確認のため3.5.2)
  • TensorFlow 1.8.0
  • Keras 2.1.6(4章では他のライブラリとの関係があるため2.1.2)
  • h5py 2.7.1
  • numpy 1.14.0
  • scipy 1.0.0
  • quiver-engine 0.1.4.1.4
  • matplotlib 2.1.1
  • picklable_itertools 0.1.1以上
  • sacred 0.6.10以上
  • tqdm 4.8.4以上
  • q 2.6以上
  • gensim 3.2.0
  • nltk 3.2.5
  • scikit-learn 0.19.1
  • pandas 0.22.0
  • Pillow 4.3.0
  • gym 0.10.5
  • pygame 1.9.3
  • html5lib 0.9999999
  • keras-adversarial 0.0.3
  • PyYAML 3.12
  • requests 2.14.2
GPUを使用する場合
  • tensorflow-gpu 1.8.0
  • cuda 9.0
  • cuDNN 7.0.5
Macで使用する場合の注意点

matplotlibを標準設定のまま使用すると下記のようなエラーが発生します。これはMacで設定されている標準の画像レンダリングAPIがmatplotlibで使用するものと異なるためです。

RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.

matplotlibを使用する前に下記のように画像レンダリングAPIを設定して使用してください。

import matplotlib as mpl
mpl.use('TkAgg')

動作確認済みハードウェア

  • Ubuntu 16.04 LTS(GPU:GeForce GTX 1080)
  • 64ビットアーキテクチャ
  • Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
  • 16GBのRAM
  • ハードディスクの空き容量は少なくとも10GB

正誤表

下記の誤りがありました。お詫びして訂正いたします。

本ページに掲載されていない誤植など間違いを見つけた方は、[email protected]までお知らせください。

第2刷まで

■1章 P.27 10行目

シグモイド関数は連続関数なので、微分可能です。

シグモイドは連続関数であり、微分可能です。

第1刷

■1章 P.22 1行目

from keras.layersimport Dense, Dropout, Activation

from keras.layers import Dense, Dropout, Activation

■2章 P.67 脚注

前:package_data=’quiver_engine’: ’quiverboard/dist/*’,
後:package_data=’quiver_engine’: [’quiverboard/dist/*’],

前:package_data={'quiver_engine': 'quiverboard/dist/*'},
後:package_data={'quiver_engine': ['quiverboard/dist/*']},

■3章 P.96 8~13行目

from pathlib import Path
import pathlib
import numpy as np
from PIL import Image
from keras.models import load_model

model_path = "logdir/model_file.hdf5"

from pathlib import Path
import numpy as np
from PIL import Image
from keras.models import load_model

model_path = "logdir_cifar10_deep_with_aug/model_file.hdf5"

■4章 P.112 1行目

DCGGAN生成モデルは、以下のKerasコードで実装できます。

DCGAN生成モデルは、以下のKerasコードで実装できます。

■6章 P.177 10行目

今回の場合、語彙数は42です。

今回の場合、語彙数は60です。

■6章 P.179 35~36行目

        for i, ch in enumerate(test_chars):
            Xtest[0, i, char2index[ch]] = 1

        for j, ch in enumerate(test_chars):
            Xtest[0, j, char2index[ch]] = 1

More Repositories

1

deep-learning-from-scratch

『ゼロから作る Deep Learning』(O'Reilly Japan, 2016)
Jupyter Notebook
4,018
star
2

deep-learning-from-scratch-2

『ゼロから作る Deep Learning ❷』(O'Reilly Japan, 2018)
Python
1,055
star
3

deep-learning-from-scratch-3

『ゼロから作る Deep Learning ❸』(O'Reilly Japan, 2020)
Python
722
star
4

automatestuff-ja

『退屈なことはPythonにやらせよう』のリポジトリ
Python
348
star
5

deep-learning-from-scratch-4

『ゼロから作る Deep Learning ❹』(O'Reilly Japan, 2022)
Jupyter Notebook
344
star
6

deep-learning-from-scratch-5

『ゼロから作る Deep Learning ❺』(O'Reilly Japan, 2024)
Jupyter Notebook
225
star
7

conc_ytakano

『並行プログラミング入門』(O'Reilly Japan, 2021)
Rust
209
star
8

go-programming-blueprints

Go
179
star
9

learning-react-2e-ja

『Reactハンズオンラーニング 第2版』のリポジトリ
HTML
168
star
10

ml-at-work

電子書籍『仕事ではじめる機械学習』のサポートリポジトリです
Jupyter Notebook
130
star
11

programming-typescript-ja

『プログラミングTypeScript』のリポジトリ
TypeScript
121
star
12

black-hat-python-jp-support

『サイバーセキュリティプログラミング』のサポートページ
Python
108
star
13

RecommenderSystems

『推薦システム実践入門』のリポジトリ
Jupyter Notebook
97
star
14

data-science-on-aws-jp

Jupyter Notebook
91
star
15

black-hat-python-2e-ja

Python
71
star
16

learning-three-js-2e-ja-support

JavaScript
60
star
17

real-world-http

書籍『Real World HTTP』のサポートリポジトリ
60
star
18

hands-on-nodejs

『ハンズオンNode.js』のリポジトリ
JavaScript
59
star
19

practical-go-programming

『実用 Go言語』のサポートリポジトリ
Go
59
star
20

fundamentals-of-deep-learning-ja

『実践 Deep Learning』のリポジトリ
Python
52
star
21

practical-nlp-ja

Jupyter Notebook
48
star
22

binary-hacks-rebooted

『Binary Hacks Rebooted』のサポートリポジトリ
C
46
star
23

ml-security-jp

『セキュリティエンジニアのための機械学習』のリポジトリ
Jupyter Notebook
43
star
24

artificial-intelligence-with-python-ja

『PythonによるAIプログラミング入門』のリポジトリ
Jupyter Notebook
42
star
25

julia-programming-cookbook

Jupyter Notebook
37
star
26

mithril-book-sample

『Mithril - 最速クライアントサイドMVC』のサンプルコード
JavaScript
37
star
27

unity-virtual-reality-projects-ja

C#
35
star
28

concurrency-in-go-support

『Go言語による並行処理』のサポートリポジトリです。
34
star
29

augmented-reality-game-development-ja

C#
28
star
30

mastering-linux-shell-scripting-2e-ja

Shell
27
star
31

machine-learning-with-python-cookbook

Python
22
star
32

pentest-starting-with-port-scanner

『ポートスキャナ自作ではじめるペネトレーションテスト』のリポジトリ
Shell
21
star
33

hands-on-javascript

『ハンズオンJavaScript』のリポジトリ
HTML
21
star
34

building-ml-pipelines-ja

『入門 機械学習パイプライン』のリポジトリ
Jupyter Notebook
20
star
35

automatestuff2-ja

Python
19
star
36

mobile-game-development-with-unity-ja

『Unityによるモバイルゲーム開発』のリポジトリ
C#
17
star
37

building-search-app-w-ml

『機械学習による検索ランキング改善ガイド』のサンプルコードのリポジトリ
Python
17
star
38

real-time-3d-graphics-with-webgl2-2e-ja

『初めてのWebGL 2 第2版』のリポジトリ
HTML
13
star
39

WebAssembly

『ハンズオンWebAssembly』のコードリポジトリ
JavaScript
12
star
40

OpenEndedCodebook

Python
9
star
41

nlp-with-transformers-ja

9
star
42

high-performance-python-2e-ja

Python
6
star
43

learningtypescript-ja

TypeScript
6
star
44

command-line-rust-ja

6
star
45

designing-ml-systems-ja

5
star
46

efficientlinux-ja

5
star
47

network-programmability-and-automation-ja

Python
4
star
48

practical-dl-for-cloud-mobile-edge-ja

Jupyter Notebook
3
star
49

version-control-with-git-3e-ja

2
star
50

ProgrammingPHP_4E

『プログラミングPHP 第4版』のファイル置き場
2
star