Intro to Tensorflow
Ashish Gaurav
Agenda
Tensorflow 1 vs Tensorflow 2
https://www.tensorflow.org/guide/effective_tf2 https://www.tensorflow.org/guide/migrate
What changed?
Data types (dtypes)
Following are the most common dtypes: �(full list: https://www.tensorflow.org/api_docs/python/tf/dtypes/DType)
Computation Graphs
https://www.tensorflow.org/api_docs/python/tf/Graph
Constants, Variables, Tensors
Tensorflow vs Numpy
Sessions
To run our graph, we need a session:
Neural Networks
Consider a neural network with one hidden layer:
An example:
Input x (1x5) => linear transformation xW+b => relu => hidden outputs 1x100�hidden (1x100) => linear transformation xW+b => relu => outputs 1x10
In general,
Layer inputs (1xp) => xW+b => elementwise relu => Layer outputs (1xq)�where weights W is matrix of dims pxq and bias b has dims 1xq