April 2017
Intermediate to advanced
320 pages
7h 46m
English
For a better understanding, we reported the entire source code for the CNN previously discussed:
import tensorflow as tf import numpy as np from tensorflow.examples.tutorials.mnist import input_data batch_size = 128 test_size = 256 img_size = 28 num_classes = 10 def init_weights(shape): return tf.Variable(tf.random_normal(shape, stddev=0.01)) def model(X, w, w2, w3, w4, w_o, p_keep_conv, p_keep_hidden): conv1 = tf.nn.conv2d(X, w, strides=[1, 1, 1, 1], padding='SAME') conv1_a = tf.nn.relu(conv1) conv1 = tf.nn.max_pool(conv1_a, ksize=[1, 2, 2, 1] ,strides=[1, 2, 2, 1], padding='SAME') conv1 = tf.nn.dropout(conv1, p_keep_conv) conv2 = tf.nn.conv2d(conv1, w2, strides=[1, 1, 1, 1], padding='SAME') ...
Read now
Unlock full access