© Umberto Michelucci 2018Umberto MichelucciApplied Deep Learninghttps://doi.org/10.1007/978-1-4842-3790-8_10
10. Logistic Regression from Scratch
toelt.ai, Dübendorf, Switzerland
In Chapter 2, we developed a logistic regression model for binary classification with one neuron and applied it to two digits of the MNIST dataset. The actual Python code for the computational graph construction was just ten lines of code (excluding the part that performs the training of the model; review Chapter 2, if you don’t remember what we did there).
X = tf.placeholder(tf.float32, [n_dim, None])
Y = tf.placeholder(tf.float32, [1, None])
learning_rate = tf.placeholder(tf.float32, shape=())
W = tf.Variable(tf.zeros([1, n_dim])) ...