Please enable JavaScript.
Coggle requires JavaScript to display documents.
Tensorflow_101 (Common function (tf.sigmoid(x, name=optional) (element…
Tensorflow_101
Common function
tf.constant(value, dtype, shape=optional, name=optional)
-
tf.matmul(a, b , ...): a, b must be of the same type
tf.sigmoid(x, name=optional)
-
-
-
-
tf.add(a, b, name=optional) --- Element-wise addition operation
tf.nn.sigmoid_cross_entropy_with_logits(logits, labels, name=optional)
-
tf.one_hot(indices=classes, depth=row_length, ..) : Need to practice more for this function
tf.reduce_mean(input_tensor, axis=None, keep_dims=False)
Variable
-
tf.Variable(initial_value, name=optional)
One initialized, a variable has fix shape and dtype (still can change)
tf.ones(shape, dtype, name=optional)
np.ravel vs np.flatter: the latter returns a COPY while the former return a VIEW. Be careful when modifying array returned by np.RAVEL()
tf.get_variable
very flexible for INITIALIZATION for Neural Network, etc.................
shape [dim_1, None] is DIFFERENT to [dim_1, ]
Insights
-
- You run a session and feed data to these placeholders
- Guide TF to construct computational graph(s)
- TF will evaluate your functions
-
Steps to run tensorflow
- Declaration above does not evaluate or initialize values but just alert the system about the existence of these tensor.
- Call a session and then this session will evaluate these values.
-
- Initizalize these declared variables
tf.placeholder(dtype, shape=optional, name=optional)
-
"feed_dict" must be provided in Session.run(), Tensor.eval() or Operation.run()
-
if shape is not specified, you can feed input of any shape