What is lambda in Python? First, it is an expression, so called lambda expression. The expression evaluates to the value after the colon. Since it’s an expression, it can occur […]

Believe or not, you can run python code in GDB. (gdb) python print(“hello world”) &”python print(\”hello world\”)\n” ~”hello world\n” ^done (gdb) In the above example, we call the python function […]

Softmax is unlike other activation functions such as tanh and sigmoid, which take one number as input and output one number. Softmax activation function takes several numbers as input and […]

MNIST dataset is a frequently used image dataset for neuron network and deep learning study. How to download the MNIST dataset? import tensorflow as tf (X_train, y_train), (X_test, y_test) = […]

Tensorflow TensorArray

tf.TensorArray is a class, not a function. You can use tf.TensorArray to construct a TensorArray operation: ta = tf.TensorArray(dtype=tf.float32, size=2)   Here, the tensorarray contains 2 tensors. How to get […]

Attributes of tensorflow operations

Consider the following example: a=tf.constant([[1,2,3],[4,5,6]],shape=(2,3),name=”a”) b=a+1 It will produce the following graph: We can see a constant tensorflow operation has two attributes: dtype is the type of the elements stored […]

The python with statement is a little strange to programmers of other languages. It is frequently occurred in tensorflow related codes like: with tf.Session() as sess: do something A new […]