WHT

List To Tensor | Tensorflow 2.0: How To Convert List To Tensors

Freeai

Subscribe Here

Likes

1

Views

36

Tensorflow 2.0: How To Convert List To Tensors

Transcript:

Hello, everyone! Welcome back in the previous lecture on getting started with Google Collab, we have installed Google Collab in your Google drive and we opened that Google Collab and imported tensorflow. And as you can see that this file. What are the file you have created? It will save in whatever the destination folder you have set. For example, I created the Google Collab in my drive, logistic regression and tensorflow I create right, click that and created the new Google Cloud and this is what it’s mean so we can open that Google Collaboratory notebook by just double click here, so I just double click that and just wait for a few seconds until it gets open. Okay, and this is what the for this is. What the file what we have used and we imported the Tensorflow 2.2 So what we will do now is just first. We connect that to the GPU in the previous settings we use the GPU. Let’s connect that. Just wait for a few seconds until it gets connected. Yeah, now it’s got connected. So let me change the name. Instead of untitled zero. Let me change the name to zero one. It’s my tensorflow and way to turns out low version two, and it is what my creating tense arts. Okay, now let’s execute the Stanza flow version to point X and important airflow and check the vertical again right now. There are three ways of creating the tensions so creating tensions Is my headache. Creating tensions, there are three ways of creating one is through list and second is through array using numerical python and third one. You can use start with the tensile flow constants. Okay, so there are three ways that what we’ll see. Now, first, what I will do is that I’ll create the basic list and let me name it as my list is equal to let me create a list with one two, three, four and five, and this is what the list I have created and if you look into the data type of my list, my underscore list and this is what my list is a list perfect now. What I will do is that you can using tensorflow. I can convert this data type converting data type using tensorflow. Okay, so how to do that? Let me name it as individual TF and this is what my list is equal to tf dot convert to tensor. And you can see the suggestion says that it’s a value so what you need to do? Is that basically to pass? The value means the value in this case, It’s an object, my list comma and the data type just specify the data type if you want and I’ll specify the data type TF DOT Float32 32-bit is what the data type I’m setting it now, so execute that so now we can see that it is successfully converted into tensorflow. Sorry into 10 charts. Let me check the data type TF underscore list as you can see that it was the Tensorflowpython Framework Ops, eager tensor. Okay, so this is what the datatype intents are, and this is what the specially used eager tensor is, actually, um, the tensor. This is the new it is available. Only in the newer version of tensorflow. Basically, the entire Tensorflow 2 version 2 is completely on eager, eager approach in the tensile flow version 1 It’s not an eager approach. It’s basically the Graphical approach. We’ll talk more about that eager and also the graphical approach in the coming lecture series before that. Let’s try to understand how to create any data type into the tensors. Now let’s create a multi-dimensional list like, you know, I can create the multi-dimensional list, saying that that’s nothing, but my Nestor list within the list. Let me create one more list, One comma, two comma, three comma, four and five, and this is my list. You can print the my list, and this is basically the list of, uh, basically that this representation is called list with only one row. Okay, and basically, it’s a one dimension tensor, so let’s create how to how to convert that into tensorflow so tf dot convert to tensor so my underscore list. Okay, and let me change the data type to TF DOT float 32 Okay, and let’s let me name it as my list one. Oh, this is float, not floated21. It’s a float 32 bit exactly. Yes, now you can see that it’s successfully converted. Let me print that, you know. What is the tf last one and tf list first? Let me print. PF underscore list and TF underscore list. Is what the normal list. Which was I used is a simple list consists of one, two, three and four five. And this is what the output of the tensor. It says that it is Tensa. Actually, it’s a zero dimension tensor with just a simple tensor and what you can see is just the values and the shape that’s specified. Is 5 comma. Something means it’s an either a column matrix, not a row matrix or it’s not at all a vector at all, okay, and the data type. It is float32. Okay, and now let me print the tier underscore list. One, let me print this first and as you now, you can see that it says that it is shape is one comma pi and the rank of this matrix is one. It is basically a one dimension tensor. One D tensor. Basically, it is simple like a column map. Sorry, it’s simply like a row matrix. Any row matrix or a column matrix you call as a 1d tensor. So this is how I can create a 1d tensor using the nester list. Got it, so let me create the column wise tensor, so using my list and let me name it As a column. I can create the Leicester list within our list. Let me create the one list, one and comma, one or less two, three, four and five, so let me convert that into tensor So tf underscore list two, it’s not iphone. Yeah, underscore is equal TF dot convert to tensor my list column and specify the data type. It is tf dot floor 32-bit. Now let me print it TF underscore list 2 It is let me print that. Let’s see now what it did displays, so it shows that it is a column vector or one dimension tensor, where the column weighs wise and the shape of that is five rows and one column. That is what we can see from the list you.

0.3.0 | Wor Build 0.3.0 Installation Guide

Transcript: [MUSIC] Okay, so in this video? I want to take a look at the new windows on Raspberry Pi build 0.3.0 and this is the latest version. It's just been released today and this version you have to build by yourself. You have to get your own whim, and then you...

read more