附录A 实现鱼类识别

以下是第1章中鱼类识别部分的完整代码。

在讲解了鱼类识别示例的主要构建模块后,我们将所有代码段落连接在一起,来看看如何使用几行代码构建一个复杂的系统。

#Loading the required libraries along with the deep learning platform Keras with TensorFlow as backend import numpy as np np.random.seed(2017) import os import glob import cv2 import pandas as pd import time import warnings from sklearn.cross_validation import KFold from keras.models import Sequential from keras.layers.core import Dense, Dropout, Flatten from keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D from keras.optimizers import SGD from keras.callbacks import EarlyStopping from keras.utils import np_utils from sklearn.metrics import log_loss from keras import __version__ as keras_version # Parameters # ---------- ...

Get 深度学习:核心原理与案例分析 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.