Tim Blog

Himmel oder Hölle

tensorflow cnn

tf.nn.conv2d(input, filter, strides, padding, use_cudnn_on_gpu=None, name=None) input: input tensor for converlution with shape [batch, in_height, in_width, in_channels] filter: kernel tensor...

tensorflow batch normalization

batch normalization is introduced to solve Internal Covariate Shift problem Internal Covariate Shift means that parameter changes in one layer can lead to input data distribution changes for next l...

tensorflow backward propagation

high level optimizer=tf.train.GradientDescentOptimizer(learning_rate=learning_rate) train=optimizer.minimize(cost, name='train') low level for one hide layer model dc_dw_out, dc_db_out=tf.grad...

tensorflow dropout

dropout can decrease the overfit probability during training and increase the accuracy during prediction dropout should be used on in training and not in validation and testing dropout is used af...

machine-learning activation function

the purpose of activation function is to increase the non-linearity of ML model, so that classification can be done better. it can also be imagined as twisting the space to find linear boundary ...

machine-learning Softmax

softmax function softmax is used to to transform multi-output values in (0, 1) zone, so that a proper selection according to max. probability can be made the mathmatical expression is shown: ...

tensorflow save and serve model

save model import tensorflow as tf w1=tf.Variable(tf.random_normal(shape=[2]), name='w1') w2=tf.Variable(tf.random_normal(shape=[5]), name='w2') saver=tf.train.Saver([w1,w2]) # tf.train.Saver()-&g...

python yield function

the yield is able to execute an expression and return a value in time sequence rather than calculate them all and return in list; mostly used as generator yield example return multivalue in sequen...

python random seed

numpy np.random.seed() & np.random.RandomState() np.random.seed() this is to set a global seed for np.random; it can be used for mist dataset iterator, mist.train.nextbatch(), sinc...

tensorflow Variables

tf.Variable initialization variables in tensorflow must be initialized with tf.global_variables_initializer sess.run(tf.global_variables_initializer()) definition variable definition can be do...