TensorFlow Tutorial 2 - Tensor Basics

Поділитися
Вставка
  • Опубліковано 30 лип 2024
  • In this video we go through the most basic and essential tensor operations that really build the foundation to TensorFlow 2.0 and is important to know before moving on to building neural networks which we will start with in the next tutorial! :)
    Knowledge in Linear Algebra is very important to have an easier time understanding many tensor operations we go through so I would view as a prerequisite. I think if you don't have that then this series by 3Blue1Brown can be helpful:
    • Essence of linear algebra
    ❤️ Support the channel ❤️
    / @aladdinpersson
    Paid Courses I recommend for learning (affiliate links, no extra cost for you):
    ⭐ Machine Learning Specialization bit.ly/3hjTBBt
    ⭐ Deep Learning Specialization bit.ly/3YcUkoI
    ⭐ TensorFlow Specialization bit.ly/3FmEVK1
    📘 MLOps Specialization bit.ly/3wibaWy
    📘 GAN Specialization bit.ly/3FmnZDl
    📘 NLP Specialization bit.ly/3GXoQuP
    ✨ Free Resources that are great:
    NLP: web.stanford.edu/class/cs224n/
    CV: cs231n.stanford.edu/
    Deployment: fullstackdeeplearning.com/
    FastAI: www.fast.ai/
    💻 My Deep Learning Setup and Recording Setup:
    www.amazon.com/shop/aladdinpe...
    GitHub Repository:
    github.com/aladdinpersson/Mac...
    ✅ One-Time Donations:
    Paypal: bit.ly/3buoRYH
    ▶️ You Can Connect with me on:
    Twitter - / aladdinpersson
    LinkedIn - / aladdin-persson-a95384153
    Github - github.com/aladdinpersson
    OUTLINE:
    0:00 - Introduction
    0:48 - Imports
    2:21 - Initialization methods for Tensors
    8:34 - Casting to different types
    9:36 - Mathematical Operations
    15:16 - Indexing a Tensor
    19:18 - Reshaping a Tensor
    20:40 - Ending words

КОМЕНТАРІ • 105

  • @SujayAmberkar
    @SujayAmberkar 3 роки тому +40

    Just what I needed!!! I was trying to learn deep learning by MIT but it required tensorflow and i don't like to read docs. You explained it from scratch which I loved the most. Awesome!!!

    • @AladdinPersson
      @AladdinPersson  3 роки тому +8

      Thank you so much for the kind words 🙏

    • @thevoid5181
      @thevoid5181 8 місяців тому

      tensorflow has their own videos too but i think this one is much more easier to undertand and informative

  • @mohamadali-io8bp
    @mohamadali-io8bp 3 роки тому +39

    this guys is the best watch ads to suport him honestly thanks man

  • @cmacompilation4649
    @cmacompilation4649 3 роки тому +2

    Can I just say, youuuuuuuuuuuuuuuuuuu AAAAAAAAAAAAARRRRREEEE the best to explain TF till now, thanks man

  • @prayashshrestha249
    @prayashshrestha249 3 роки тому +4

    I was trying to understang somthing else and I came to one of your video and I checked out ur contents. They are awesome. Hope to get much more content from you. Keep Posting

  • @sunilsharanappa7721
    @sunilsharanappa7721 3 роки тому +2

    Your explanation is awesome. please keep going and create more content. Thanks for your efforts in creating amazing videos.

  • @bastianknaus6556
    @bastianknaus6556 3 роки тому +2

    Thank you so much! This saved me so much time. Great tutorial!

  • @andresyesidmorenovilla7888
    @andresyesidmorenovilla7888 3 роки тому +3

    Dude, you're so underrated, you're videos are the best!

  • @rocksneha059
    @rocksneha059 3 роки тому +19

    It is called delta becuase in differenatial mathematics, delta x/delta y represents differential equation and delta represents 'difference'. So difference= step

  • @hemanthreddykunduru2769
    @hemanthreddykunduru2769 2 роки тому

    Sir, you are apitome of teaching tensorflow bcz I just saw many of teaching people in UA-cam u made me best ❤️❤️

  • @devdew6407
    @devdew6407 3 роки тому +1

    Great tutorial for beginners. Thank you so much!

  • @shamimsasani6765
    @shamimsasani6765 Рік тому +1

    Thank you for your excellent tutorials...I searched so much for something like this and finally, it's all here!!!
    sorry to mention but you need to say that " x ** 5 " is NOT elementwise multiplication but rather it is " to the power of 5" for each element. I was confused at first but then I checked it with some random number and it was right.

  • @AltafHussain-gk2xe
    @AltafHussain-gk2xe 3 роки тому +1

    Sir, than you for such a worthfull and helpful video and also your teaching methodology is out of the world please keep it up

  • @purva4752
    @purva4752 2 місяці тому +1

    great and clear explaination of the tensorflow. thank you

  • @jakebennett4558
    @jakebennett4558 3 роки тому

    Thanks for the quality videos. Really helped me out.

  • @youcefsb4708
    @youcefsb4708 3 роки тому +4

    12:59 answer: because that is the behavior of reduce function using a sum callback (reduce a vector into a scalar representing the sum of its elements), while sum is like adding two elements or two vectors pointwise.

  • @muhammadumarsotvoldiev8768
    @muhammadumarsotvoldiev8768 Рік тому +1

    thank u. short and clear intro.

  • @rahul-qo3fi
    @rahul-qo3fi 2 роки тому +1

    Thanks man, this just saved me a ton of time

  • @parthasarathyk5476
    @parthasarathyk5476 2 роки тому

    Awesome content. Very easy and nicely explained. Great job....

  • @jeremynx
    @jeremynx 3 роки тому

    Thank you very much! you are explaining so well

  • @vatsal_gamit
    @vatsal_gamit 3 роки тому

    Thank You so much for those amazing videos!! Love from India

  • @xy1293
    @xy1293 3 роки тому

    thank you so much for this tutorial

  • @DevsLikeUs
    @DevsLikeUs 3 роки тому

    Great tutorial

  • @golnazra4707
    @golnazra4707 3 роки тому +2

    Thank you for this awesome tutorial. I have a problem with GPU limitation lines, they don't work for me. My TensorFlow version is 2.3.0. I`ll appreciate it if anyone tells me how to fix it.

  • @sudhansumtripathy
    @sudhansumtripathy Рік тому +1

    really very very good explanation in this video

  • @samthrimavithana8243
    @samthrimavithana8243 3 роки тому

    Thanks very clear ....add you ti my fav tutors

  • @chaosmaker781
    @chaosmaker781 2 роки тому +1

    the intro is just legendary :D

  • @Asif-Ali92
    @Asif-Ali92 4 місяці тому

    This was awesome!

  • @alisiraj2100
    @alisiraj2100 3 роки тому

    Clear explanations

  • @wolfisraging
    @wolfisraging 4 роки тому +2

    please do more such tensorflow tutorials... loved it

  • @yoyotl80
    @yoyotl80 3 роки тому

    Love your intro !

  • @KiranSharma-ey6xp
    @KiranSharma-ey6xp 2 роки тому

    Nicely explained (y)

  • @karthikb.s.k.4486
    @karthikb.s.k.4486 3 роки тому

    What is the settings of pycharm have you used it looks good

  • @sonalsahay723
    @sonalsahay723 Місяць тому

    Thanks!

  • @adamlasry1691
    @adamlasry1691 3 роки тому

    Thanks a lot

  • @user-zr8fg3nn3v
    @user-zr8fg3nn3v Місяць тому

    thanku for all your lectures which are full of knowledge ,can u please make a video on einops if possible, thankyou in advance

  • @jeremynx
    @jeremynx 3 роки тому

    Want to watch all your videos!

  • @timecop1983Two
    @timecop1983Two Рік тому +1

    Yeah I am 14 and when I wanted to do this I needed to first learn linear algebra. Then I could get back here.

  • @carloanimationTV
    @carloanimationTV Рік тому

    what are the pre-requisite of learning machine learning because I only resort to coursera do I need to re-enroll algebra, calculus and statistics I have this back in college but that was 20 years ago but I dont care about these subjects before but now I badly needed it .

  • @NaqiARizvi
    @NaqiARizvi 8 місяців тому

    delta is denoted for 'change btw present and past values'.
    your tutorials are very good for us as a beginner :)

    • @SirenSound__
      @SirenSound__ 8 місяців тому

      I thought it was from the dirac-delta function or impulse function

  • @cardsigner
    @cardsigner 3 роки тому

    Thank you for explaining to us this tensorflow technology. Can you elaborate a little, in your 'stddev=1, mean=0', when I tried to compute the standard deviation or mean, I cannot get the expected values of 1 or 0. Thanks.

    • @THEPAGMAN
      @THEPAGMAN 2 роки тому

      probably because you used a small sample? try with a bigger matrix

  • @dijkstra4678
    @dijkstra4678 2 роки тому

    Great!

  • @nebenmensch5325
    @nebenmensch5325 3 роки тому

    lovely voice and content

  • @anonnimoose7987
    @anonnimoose7987 Рік тому

    Using a VM because I'm having a hard time installing it in Windows. Are there any CPU specific operations I should run?

  • @AhmedIqbal
    @AhmedIqbal 4 роки тому +2

    Thanks very much Prince Aladdin, we're waiting for next tutorial of TensorFlow :)

  • @FaberLSH
    @FaberLSH 15 днів тому

    Nice

  • @yousfoss4367
    @yousfoss4367 2 роки тому

    what about tensor representation and decomposition. please . thks

  • @dbiswas
    @dbiswas 2 роки тому

    Just curious how did make your avatar picture so cool? Did you use some Neural Network logic? Thanks

  • @valentinrack6028
    @valentinrack6028 Рік тому

    Great video! Please con you help me guess which is your VSCode theme for the video? I notice is veeery nice and relaxing for tutorials. It would help so much,, thank you.

  • @utkarshjain210
    @utkarshjain210 3 роки тому

    import tensorflow as tf
    d=tf.constant([3])
    e=tf.constant([5])
    print(d+e)
    Tensor("Add_5:0", shape=(), dtype=int32)
    it is not showing addition output ?

  • @seekwhen1848
    @seekwhen1848 3 роки тому +1

    What color scheme for the fonts are you using? It looks very subtle and pretty.

  • @bintemamunmaliha6053
    @bintemamunmaliha6053 3 роки тому +2

    My operating system is MacBook pro, so I cannot have the Cuda library. Is it a big problem not having a Cuda library for working with TensorFlow.

    • @AladdinPersson
      @AladdinPersson  3 роки тому

      No, you can still learn about it just using the cpu

  • @alireza7520
    @alireza7520 3 роки тому +2

    owesome! I found it realy useful. How can i make a contact with you? Several questions i have with regards to neural-networks in tensorflow. Indeed, you already have made a nice video on it, but i need to run it with some extra details.

    • @AladdinPersson
      @AladdinPersson  3 роки тому

      I mostly respond here on UA-cam so ask them and I will try my best to answer

  • @manasviemmadi8072
    @manasviemmadi8072 2 роки тому +1

    at 12:22 , could anyone please explain as to what does axes=1 exactly is representing in tf.tensordot? like in terms of row and columns

    • @chetankumar9463
      @chetankumar9463 2 роки тому

      It represent horizontal axis which is a row. Column axis is 0.Here it means to multiplying corresponding row elements with each other.

  • @mahneh7121
    @mahneh7121 Рік тому +1

    Cool video. Thank you.
    For the normal distribution of values, this is better thought as probability I think. It is also called gaussian distribution.
    The mean is where in the "X axis" the max probability is, and stddev means how wide it is. mean=0, the peak is at 0 stddev=1 means that the probability for a value to be between -1 and 1 is 65%.

    • @harrypadarri6349
      @harrypadarri6349 Рік тому

      You’re right that it has to do with probability.
      But it’s not the probability of a point because in case of a continuous distribution like the Gaussian a point has no probability.
      Think about it this way: What is the probability to sample a point from an infinite set of points(the real numbers)?
      The mean of a normal distribution is where the density function has its maximum (the peak of the typical bell curve) which is not the probability of the point.
      You get a probability by integrating over the probability density function.
      That’s called the cumulative density function.
      The Gaussian density integrates to 1 and is symmetric at the mean which you can visually see by looking at the bell curve.
      This means that the cumulative density function equals 1/2 at the mean.
      In terms of probability it means that the probability to sample a value equal to the mean or smaller is equal to 1/2.
      Of course you want to sample a point.
      You can do that by sampling a number from a uniform distribution from zero to one.
      Then you look up at which point the cumulative density is equal to the value which you drew from the uniform distribution.
      That point is the value which you sampled from the normal distribution.

    • @mahneh7121
      @mahneh7121 Рік тому +1

      @@harrypadarri6349 I said between -1 and 1

    • @harrypadarri6349
      @harrypadarri6349 Рік тому

      @@mahneh7121 woops, then I misunderstood. :)

    • @harrypadarri6349
      @harrypadarri6349 Рік тому

      Was because of “mean is … where the max probability is”.

    • @mahneh7121
      @mahneh7121 Рік тому

      @@harrypadarri6349 Yes that just meant where the derivative is 0, the right word is probability density maybe.

  • @notallama1868
    @notallama1868 Рік тому

    I think it's called delta because delta is often used to represent the change between to datapoints in an equation.

  • @user-un8gj1je5m
    @user-un8gj1je5m 10 місяців тому

    Not able to install tensor flow in my system by using command ' pip install tensorflow '. could you please help me to proceed further.
    error message as "Unable to create process using 'C:\Users\Smriti singh\.conda\envs\tf_cpu\python.exe "C:\Users\Smriti singh\.conda\envs\tf_cpu\Scripts\pip-script.py" install tensorflow'"

  • @ikhlakh3864
    @ikhlakh3864 2 роки тому +1

    Where is code ?? which is used in this Video .

  • @pankajshinde475
    @pankajshinde475 4 роки тому

    Where are you learning this things😐, quite an nice tutorial🙇‍♂️

    • @AladdinPersson
      @AladdinPersson  4 роки тому +4

      Mostly from the TensorFlow official tutorials and inofficial tutorials on Github etc. I feel that most of the guides and tutorials are quite scattered and that's also why I think these videos might be helpful for people learning TensorFlow, or for people who simply learns better from videos than from reading :)

    • @pankajshinde475
      @pankajshinde475 4 роки тому

      @@AladdinPersson can you please implement RNN from scratch in python it will be very helpful🙂

  • @sohaibshah1771
    @sohaibshah1771 10 місяців тому

    Delta mean change /difference between two value.

  • @haideralishuvo4781
    @haideralishuvo4781 4 роки тому

    Good Job ,But continue On Implementing paper on Pytorch but

  • @abdelhaksaouli8802
    @abdelhaksaouli8802 3 роки тому

    tf.random.uniform, by default it gives values between 0 and 1

  • @lucadifazio2735
    @lucadifazio2735 Місяць тому

    I wonder why some methods have axEs and some have axIs

  • @michaelmurphy7031
    @michaelmurphy7031 3 роки тому

    as simple some of the examples are, my opinion for this and the later episodes is to have source code available. Most developer learning's have source code; even a .TXT equivalent is good to have; it saves alot of mistypes.

  • @jjghyuftydyt
    @jjghyuftydyt 2 місяці тому

    at this time ua-cam.com/video/HPjBY1H-U4U/v-deo.htmlsi=1LuF3tB1C35rGOYO&t=791 within the video, what is the difference between doing "axes" vs "axis"? why do they return the same thing if you are calling a different kwarg (keyword arguement?). I accidentally put "axes" under both lines, for me line 41 and 42 respectively, and line 42 failed when I was supposed to put "axis". I fixed it and it worked but I want to understand why.

  • @veeru840
    @veeru840 Рік тому

    what is shape?

    • @parthpatwari3174
      @parthpatwari3174 7 місяців тому

      it states how many rows and columns are in that tensor
      like a rubiks cube might me 3x3x3, 4x4x4, 3x2x2 and more

  • @alqac82
    @alqac82 3 роки тому

    can not thank you enough

  • @timeWaster76
    @timeWaster76 6 місяців тому

    delta means change in Greek

  • @adityakarri1997
    @adityakarri1997 3 роки тому

    Is this Tensflow 1 or Tensflow 2?

  • @mysocial
    @mysocial 3 роки тому

    Like it, just the presentation frequently interrupted by some kind of hesitations doubts question or pause cutting the flow. Feeling going to some useless points details

    • @AladdinPersson
      @AladdinPersson  3 роки тому

      I understand what you mean. I might've cut the video unecessarily much, will try my best to make it more smooth in future videos

  • @Jason-ru7xt
    @Jason-ru7xt 3 роки тому

    you sounds like Bucky

  • @veeru840
    @veeru840 Рік тому

    why i need to call zeors?

  • @thatchessguy7072
    @thatchessguy7072 3 роки тому +1

    @8:03 I think the delta comes from mathematics.

  • @saqiblatif6235
    @saqiblatif6235 2 роки тому +1

    You are not telling why you are using this function. please teach us every everything.

  • @deborshikashyap6745
    @deborshikashyap6745 11 місяців тому

    I find Tensorflow more like pytorch

  • @maths1637
    @maths1637 Рік тому

    eye naming was totally nonsense

  • @Ragatokk
    @Ragatokk 2 роки тому +1

    I'm trying to follow the turorial, but I get some errors.
    import os
    os.environ['TF_CCP_MIN_LOG_Level'] = '2'
    import tensorflow as tf
    x = tf.constant(1, 2, 3)
    y = tf.constant(9, 8, 7)
    z = tf.tensordot(x, y, axes=1)
    print(z)
    gives:
    C:\Users\andre\anaconda3\envs\tf\python.exe C:/Users/andre/PycharmProjects/our_first_project/main.py
    2022-01-15 04:56:26.016768: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX AVX2
    To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
    2022-01-15 04:56:26.537769: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1510] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 6007 MB memory: -> device: 0, name: NVIDIA GeForce RTX 2070 with Max-Q Design, pci bus id: 0000:01:00.0, compute capability: 7.5
    Traceback (most recent call last):
    File "C:\Users\andre\PycharmProjects\our_first_project\main.py", line 8, in
    z = tf.tensordot(x, y, axes=1)
    File "C:\Users\andre\anaconda3\envs\tf\lib\site-packages\tensorflow\python\util\dispatch.py", line 206, in wrapper
    return target(*args, **kwargs)
    File "C:\Users\andre\anaconda3\envs\tf\lib\site-packages\tensorflow\python\ops\math_ops.py", line 5042, in tensordot
    ab_matmul = matmul(a_reshape, b_reshape)
    File "C:\Users\andre\anaconda3\envs\tf\lib\site-packages\tensorflow\python\util\dispatch.py", line 206, in wrapper
    return target(*args, **kwargs)
    File "C:\Users\andre\anaconda3\envs\tf\lib\site-packages\tensorflow\python\ops\math_ops.py", line 3654, in matmul
    return gen_math_ops.mat_mul(
    File "C:\Users\andre\anaconda3\envs\tf\lib\site-packages\tensorflow\python\ops\gen_math_ops.py", line 5695, in mat_mul
    _ops.raise_from_not_ok_status(e, name)
    File "C:\Users\andre\anaconda3\envs\tf\lib\site-packages\tensorflow\python\framework\ops.py", line 6941, in raise_from_not_ok_status
    six.raise_from(core._status_to_exception(e.code, message), None)
    File "", line 3, in raise_from
    tensorflow.python.framework.errors_impl.InvalidArgumentError: cannot compute MatMul as input #1(zero-based) was expected to be a double tensor but is a complex64 tensor [Op:MatMul]
    Process finished with exit code 1

    • @Ragatokk
      @Ragatokk 2 роки тому

      It did not help to add:
      physical_devices = tf.config.list_physical_devices('GPU')
      tf.config.experimental.set_memory_growth(physical_devices[0], True)

  • @cedricmanouan2333
    @cedricmanouan2333 4 роки тому

    Great !