Skip to content

Commit d48c985

Browse files
author
Vineet John
committed
Added explanation for 1b and added logging and bash script commands
1 parent be322c1 commit d48c985

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

assignments/a5/a5.tex

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,42 @@ \section{Tensorflow - MNIST} % (fold)
5454
\label{tab:accuracy_comparisons_i}
5555
\end{table}
5656

57-
\textbf{Discussion:}
57+
\textbf{Discussion:}\\
5858
The reason than the CNN performs the best is because it considers patches of the image rather than the intensities of sequential pixels. Since the CNN preserves this 2-D information structure, it performs the best of the lot.
5959

6060
% subsection softmax_vs_cnn_vs_fully_connected (end)
6161

62+
\subsection{CNN - ReLU vs. Sigmoid Units} % (fold)
63+
\label{sub:cnn_relu_vs_sigmoid_units}
64+
65+
\begin{table}[th]
66+
\centering
67+
\begin{tabular}{| l | r |}
68+
\hline
69+
\textbf{Neural Net Unit Type} & \textbf{Accuracy} \\
70+
\hline
71+
\hline
72+
Rectified Linear Units & 0.9664 \\
73+
\hline
74+
Sigmoid Units & 0.7903 \\
75+
\hline
76+
\end{tabular}
77+
\caption{Accuracy Comparisons - II}
78+
\label{tab:accuracy_comparisons_ii}
79+
\end{table}
80+
81+
\textbf{Discussion:}\\
82+
ReLUs were found to greatly accelerate the convergence of stochastic gradient descent compared to the sigmoid function. It is argued that this is due to its linear, non-saturating form. (Saturation happens for the sigmoid function at the tail of it's outputs 0 and 1, where the gradient is almost 0.)
83+
84+
% subsection cnn_relu_vs_sigmoid_units (end)
85+
86+
\subsection{Tweaking Dropout Level} % (fold)
87+
\label{sub:tweaking_dropout_level}
88+
89+
90+
91+
% subsection tweaking_dropout_level (end)
92+
6293
% section tensorflow_mnist (end)
6394

6495

tensorflow-mnist/processors/cnn_processor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def process(self):
5656
accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
5757
sess.run(tf.global_variables_initializer())
5858
for i in range(1001):
59+
log.info("Training iteration: " + str(i))
5960
batch = mnist.train.next_batch(50)
6061
if i % 100 == 0:
6162
train_accuracy = accuracy.eval(feed_dict={

tensorflow-mnist/scripts/run-tensorflow-mnist.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ CODEDIR=$(dirname "$0")"/../"
77

88
# Run Convolutional Neural Network learning processor
99
/usr/bin/python3 "$CODEDIR"/tensorflow_mnist.py --mode cnn
10+
11+
# Run Fully-Connected Feedforward neural net
12+
/usr/bin/python3 "$CODEDIR"/processors/fully_connected_network_processor.py

0 commit comments

Comments
 (0)