Basic Tensor Flow

Basic Tensor Flow
Programming Model and Basic ideas
A TensorFlow computation is delineated by a directed
graph, that consists of a collection of nodes. The graph
represents a dataflow computation, with extensions for
allowing some styles of nodes to keep up and update
persistent state and for branching and process management
structures inside the graph during a manner almost ,
 shoppers generally construct a machine graph
using one in every of the supported frontend languages (C++ or
Python). Associate in Nursing example fragment to construct then execute
a TensorFlow graph victimisation the Python face is
shown in Figure oneand also the ensuing computation graph,
In a TensorFlow graph, every node has zero or a lot of inputs
and zero or a lot of outputs, and represents the representation
of Associate in Nursing operation. Values that flow on traditional
edges within the graph (from outputs to inputs) ar tensors,
arbitrary spatial property arrays wherever the underlying component
type is nominal or inferred at graph-construction
time. Special edges, referred to as management dependencies, can
also exist within the graph: no information flows on such edges,
but they indicate that the supply node for the management dependence
must end capital punishment before the destination
node for the management dependence starts capital punishment. Since
our model includes changeable state, management dependencies
can be used directly by shoppers to enforce happens before
relationships. Our implementation conjointly typically inserts
control dependencies to enforce orderings between
otherwise freelance operations as the simplest way of, as an example,
controlling the height memory usage

Common TensorFlow operations and their respective shortcuts

TensorFlow operator Shortcut Description
tf.add() a + b Adds a and b, element-wise.
tf.multiply() a * b Multiplies a and b, element-wise.
tf.subtract() a - b Subtracts a from b, element-wise.
tf.divide() a / b Computes Python-style division of a by b.
tf.pow() a ** b Returns the result of raising each element in a to its corresponding element b,
element-wise.
tf.mod() a % b Returns the element-wise modulo.
tf.logical_and() a & b Returns the truth table of a & b, element-wise. dtype must be tf.bool.
tf.greater() a > b Returns the truth table of a > b, element-wise.
tf.greater_equal() a >= b Returns the truth table of a >= b, element-wise.
tf.less_equal() a <= b Returns the truth table of a <= b, element-wise.
tf.less() a < b Returns the truth table of a < b, element-wise.
tf.negative() -a Returns the negative value of each element in a.
tf.logical_not() ~a Returns the logical NOT of each element in a. Only compatible with Tensor objects
with dtype of tf.bool.
tf.abs() abs(a) Returns the absolute value of each element in a.
tf.logical_or() a | b Returns the truth table of a | b, element-wise. dtype must be tf.bool.
Creating a Session

Comments