Okay, let's start with TensorFlow which will be one of our of our main tools in

this course on specializations, alongside some other libraries such as.

What is TensorFlow?

TensorFlow is a high quality production ready and

the resource friendly library for machine learning.

After it was Open Source by Google in November 2015,

it quickly became one of the most popular frameworks,

both in the community of machine learning researchers and among practitioners.

As an example, I can only mention that most of relevant tasks that

Google uses in its business are nowadays powered by TensorFlow.

And soon, this might give you an idea of what power you can get once you

master this great tool.

As you will see, in a bit later, TensorFlow is not only a great tool for

machine learning, but also is very useful to the applied math in general

due to its flexibility, and computation, and analytical power.

Let's start with how TensorFlow is organized.

The main idea implemented this time in TensorFlow is the idea of a data flow

computational model.

This idea, as simple as it may sound turns out critical for prioritization,

scalability and portability of practical, machine learning algorithms.

Let's see how it works.

A data flow graph is a graph with nodes that represent some units of computation,

and edges that represent data consumed or produced by any given node.

In other words, edges represent the flow of data on the graph.

And that's why it's called a data flow graph.

Let's see how we can express a simple function of two variables,

x and y, shown here x squared times y + y + 2.

To this end, we first introduce a few sorts of nodes.

First, we will have blue squares.

Like these ones that represent inputs to the function.

They can be variables, like these ones, x and y, or

they can be constants like the node that for a fixed number, 2 in this function.

Other nodes like these ovals represent operations, or ops for short.

That are performed on these inputs and on outputs of other ops.

Now let's make one more step with this dataflow graph and see what happens

if our inputs to the graph, not the regular numbers, but other tensors.

But what are tensors?

If you are familiar with multidimensional arrays in Numpy,

they are exactly these tensors.

In other words tensors are multidimensional mathematical objects that

can be stored as multidimensional arrays in Python or other languages.

If you've never worked with multidimensional arrays in Python,

but are only familiar with matrices or two dimensional arrays,

you can think of a list of such matrices.

This would be tensor of rank-3.

Why a rank-3, what is a rank of a tensor?

The rank of a tensor is simply the number of dimensions of the tensor.

And this number would be 3 for

our example because we will have three coordinates to store our list of matrices.

The number of the matrix, the row and the column.

One very natural example of using rank-3 tensors in finance would be stock data.

In such tensor one dimension would stand for the date, another one for

the stock ticker, and the third one for

all features of this topic that you will want to include in your analysis.

For example, if you fetch stock data for a set of stocks, and

a set of dates from who using it will return an object called a data panel

which implements a rank feed tensor of exactly this type.