Skip to Main Content
Python Deep Learning Projects
book

Python Deep Learning Projects

by Matthew Lamons, Rahul Kumar, Abhishek Nagaraja
October 2018
Intermediate to advanced content levelIntermediate to advanced
472 pages
10h 57m
English
Packt Publishing
Content preview from Python Deep Learning Projects

Module 4 – train.py

In this module, we have the joint_coordinates() and training() functions, as well as the calls to train and test the VGG16 model:

"""This module imports other modules to train the vgg16 model."""from __future__ import print_functionfrom crop_resize_transform import model_datafrom test import testimport matplotlib.pyplot as pltimport randomfrom scipy.io import loadmatimport numpy as npimport pandas as pdimport cv2 as cvimport globfrom sklearn.model_selection import train_test_splitfrom keras.models import Modelfrom keras.optimizers import Adamfrom keras.layers import Flatten, Dense, Dropoutfrom keras import backend as Kfrom keras import applicationsK.clear_session()# set seed for reproducibilityseed_val = 9000np.random.seed(seed_val) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Python Deep Learning for the Web

Hands-On Python Deep Learning for the Web

Anubhav Singh, Sayak Paul

Publisher Resources

ISBN: 9781788997096Supplemental Content