CNN Flatten Operation Visualized - Tensor Batch Processing for Deep Learning

  Рет қаралды 37,421

deeplizard

deeplizard

Күн бұрын

Пікірлер: 109
@deeplizard
@deeplizard 6 жыл бұрын
Check out the corresponding blog and other resources for this video at: deeplizard.com/learn/video/mFAIBMbACMA
@shineshine9599
@shineshine9599 5 жыл бұрын
U should have 1 million subscriber
@MrVampireutd
@MrVampireutd 5 жыл бұрын
Hello I'm facing a problem and I hope you can help me with it I'm trying to add values after making the flatten but these values must be based on each image's pixels so for each image in the training set im trying to add some values after the flatten to feed it to the fully connected network Thanks in advanced
@darshanjani7595
@darshanjani7595 3 жыл бұрын
Watching the whole ad as well as clicking the ad to support you guys❤️
@sourajitsaha4724
@sourajitsaha4724 5 жыл бұрын
t = t.reshape(t.shape[0],-1), works regardless of the number of color channels or even output channels for that matter. It's great fun - watching your videos. They are both stimulating, cognizant and informative - a rare combination to find in tutoring. Cheers mate! Keep up the good work.
@deeplizard
@deeplizard 5 жыл бұрын
Hey Sourajit - Thank you! I really appreciate that, and I'm glad you have enjoyed the playlist!!
@crespoo0
@crespoo0 4 жыл бұрын
One of the best channels!These are videos with high quality content, production animation verbal and visual explanations well put together! Thanks for doing this!
@rohitvoleti3409
@rohitvoleti3409 5 жыл бұрын
Really cool animations along with their parallel explanations, nice job
@min-youngchoi3833
@min-youngchoi3833 4 жыл бұрын
I don't expected This was interactive! Awesome!
@caninekulo8637
@caninekulo8637 4 жыл бұрын
Why don't you have more subs. This is gold
@preritjain3980
@preritjain3980 6 жыл бұрын
t.reshape(t.shape[0],-1)
@reinasama904
@reinasama904 2 жыл бұрын
Your amazing work is helping me tremendously, thank you so so much!
@howardsmith9032
@howardsmith9032 4 жыл бұрын
Excellent work guys!
@vinayaknayak7374
@vinayaknayak7374 5 жыл бұрын
t.reshape(t.size()[0], t.size()[1] * t.size()[2] * t.size()[3]) Thanks for this awesome series of tutorials and blogposts. I benefited a lot from this. Keep up the good work :)
@mpalaourg8597
@mpalaourg8597 4 жыл бұрын
i am a (couple) year late, but ... t.reshape(3, -1) does the work for the example of the video or t.reshape(t.shape[0], -1) does the work for every number of batches
@vipulmishra554
@vipulmishra554 6 жыл бұрын
This would probably seem stupid but I'm posting it since it surprisingly worked. t.reshape(int(torch.tensor(t.shape)[0]),int(torch.tensor(t.shape)[1])*int(torch.tensor(t.shape)[2])*int(torch.tensor(t.shape)[3]))
@tymo3391
@tymo3391 4 жыл бұрын
very good video!
@sqliu9489
@sqliu9489 3 жыл бұрын
Thanks for the great videos !
@ros6143
@ros6143 4 жыл бұрын
For RGB images with 3 color channels, shouldn't you use 'start_dim=2' instead of 'start_dim-1' so that each color channel of the image is flattened individually? Or do you just flatten all of them at once? Thanks!
@bidhanmajhi
@bidhanmajhi 5 жыл бұрын
I like the Ted talk in the end
@TensorWave
@TensorWave 6 жыл бұрын
Thank you for these Videos. They really help a lot for beginners !
@deeplizard
@deeplizard 6 жыл бұрын
Hey Prathmesh - You are welcome!
@Livakivi
@Livakivi 6 жыл бұрын
Thank you for another high quality video :) Here is one simple solution: t.view(t.shape[0], -1) get the first (or any) dimension with .shape, and use -1 to flatten the rest
@deeplizard
@deeplizard 6 жыл бұрын
Thanks Ulm - You're welcome! Nice solution. I like how this solution generalizes to batches of any size. 🤖
@carltondaniel8966
@carltondaniel8966 5 жыл бұрын
i understood that we combine all the layers from the image matrix to perform flattening operation , but i did not understand why are we doing this , the end result is we pass the values to the soft-max classifier which performs a multi class classification , thanks in advance
@carltondaniel8966
@carltondaniel8966 5 жыл бұрын
wonderful content!!!!
@CoolDude911
@CoolDude911 5 жыл бұрын
There's a frog on a log in a hole at the bottom of the sea. The frog is number width of the image, the log is the height, the hole is the channel and the depth is the index of the image in the data-set. Easy.
@deeplizard
@deeplizard 5 жыл бұрын
I had a lot of fun reading this. 🤣🤣🤣 It's going over my head though, so if it's not completely random, I'd love to hear more.
@MdHasan-kh4dq
@MdHasan-kh4dq 5 жыл бұрын
It's an awesome series..
@deeplizard
@deeplizard 5 жыл бұрын
Hey Md Hasan - Thank you!
@syed1297
@syed1297 4 жыл бұрын
sound effects are from bisqwit c++ simd videos?
@deeplizard
@deeplizard 4 жыл бұрын
Many creators use the same sound effects libraries 😄
@syed1297
@syed1297 4 жыл бұрын
@@deeplizard oh I didn't know that. Great content BTW. Love it, I'm binge-watching.
@carltondaniel8966
@carltondaniel8966 5 жыл бұрын
if we have 3 color channels rgb ,when we perform the flatten operation will all the 3 channels combine as one tensor , thanks in advance !!!
@deeplizard
@deeplizard 5 жыл бұрын
Yes. Here is some experimental code: r = torch.ones(1,2,2) g = torch.ones(1,2,2) + 1 b = torch.ones(1,2,2) + 2 img = torch.cat( (r,g,b) ,dim=0 ) img.shape #output: torch.Size([3, 2, 2]) img #output: tensor([[[1., 1.], [1., 1.]], [[2., 2.], [2., 2.]], [[3., 3.], [3., 3.]]]) This code gives us an rgb image that has height and width of 2. Now, flatten like this: img.flatten(start_dim=0) #output: tensor([1., 1., 1., 1., 2., 2., 2., 2., 3., 3., 3., 3.])
@desultorythoughts
@desultorythoughts 6 жыл бұрын
Great Video deserves more views 73 likes and no dislike speaks for itself
@deeplizard
@deeplizard 6 жыл бұрын
Thank you Akash!
@JimmyCheng
@JimmyCheng 6 жыл бұрын
does modern camera system's eye tracking system use CNN?
@deeplizard
@deeplizard 6 жыл бұрын
Hey Ziqiang - Not sure which ones do and which ones don't. We are likely moving in that direction though. Here are a couple of resources that look interesting: blogs.nvidia.com/blog/2016/08/30/eye-tracking-deep-learning/ arxiv.org/abs/1806.10890 stanford.edu/class/ee267/Spring2018/report_griffin_ramirez.pdf
@JimmyCheng
@JimmyCheng 6 жыл бұрын
wonderful contents, plz keep up the good work, I just happen to have a project on pytorch this summer, would be immensely helpful!
@deeplizard
@deeplizard 6 жыл бұрын
Thank you Ziqiang! Really appreciate all your comments!
@sumitvaise5452
@sumitvaise5452 5 жыл бұрын
t.reshape(3,16).squeeze(dim=1)
@morten-punnerud_engelstad
@morten-punnerud_engelstad 6 жыл бұрын
t.reshape(-1,16) or t.reshape(-1,t.flatten(start_dim=1).shape[1])
@deeplizard
@deeplizard 6 жыл бұрын
Hey Morten - You've got it. They work! Thanks for contributing these! 🚀
@farhatwissem8497
@farhatwissem8497 6 ай бұрын
t.reshape(3, -1).squeeze(dim=1)
@dranaju_oficial
@dranaju_oficial 6 жыл бұрын
t.reshape(3, -1) make the trick
@deeplizard
@deeplizard 6 жыл бұрын
Hey Junior - Excellent! I like. 🤖
@TerragonDE
@TerragonDE 6 жыл бұрын
@Junior De Jesus nice, now i also understood what exactly the -1 was doing in the last video in the def flatten(t) - function. :D
@dranaju_oficial
@dranaju_oficial 6 жыл бұрын
The -1 parameter means that the torch or numpy will figure out the unknown dimension by looking at the 'length of the array and remaining dimensions'
@baiyuzhao4281
@baiyuzhao4281 6 жыл бұрын
It's not a good answer, I think it should be t.reshape(t.shape[0], -1).
@jonatan01i
@jonatan01i 5 жыл бұрын
@@baiyuzhao4281 Was it specified that the answer should be general?
@Ruhgtfo
@Ruhgtfo 5 жыл бұрын
Mindblow
@jacobstech1777
@jacobstech1777 6 жыл бұрын
really good video, why only 467 views?
@deeplizard
@deeplizard 6 жыл бұрын
Thanks YUAN! 467 is pretty weak. I know. Hopefully it's only temporary. Thank your for your comment. I really appreciate that! :)
@jacobstech1777
@jacobstech1777 6 жыл бұрын
deeplizard I am waiting for more pytorch videos🤣
@pakhomovviktor3149
@pakhomovviktor3149 6 жыл бұрын
"PyTorch’s built-in flatten() method." Hey there, r u sure there is FLATTEN() in Pytorch? Could not find in the official Pytorch documentation.
@deeplizard
@deeplizard 6 жыл бұрын
Hey Pakhomov - You are right! The documentation is missing for the flatten function. The flatten function is new. It was added in PyTorch 4.0.1. This is the commit where the function was added: github.com/pytorch/pytorch/pull/8578 You can also see it here (search for flatten): github.com/pytorch/pytorch/releases There was an issue opened for the documentation issue. Check it out here: github.com/pytorch/pytorch/issues/9876 The issue was already fixed and merged into the master code branch. You can see it here: pytorch.org/docs/master/ To get to that link from the official docs page, use the version selector at the top, and choose master. Good eye on that one. Great attention to detail! Hope this info helps!
@djfl58mdlwqlf
@djfl58mdlwqlf 5 жыл бұрын
what is this "batch"? It's confusing me for a long time
@deeplizard
@deeplizard 5 жыл бұрын
Check out the below video and blog from our Deep Learning Fundamentals course. It is all about batches in deep learning. Let me know if it helps clarify! deeplizard.com/learn/video/U4WB9p6ODjM
@Normalizing-polyamory
@Normalizing-polyamory 6 жыл бұрын
t.reshape(3,-1)
@mohammadsadilkhan1875
@mohammadsadilkhan1875 5 жыл бұрын
img.shape #output [a,b,c,d] Img=img.reshape(img.shape[0],-1)
@grizzle8911
@grizzle8911 5 жыл бұрын
t.reshape(-1, 16)
@arastooajorian9069
@arastooajorian9069 4 жыл бұрын
b.reshape(3,-1)
@rickam9055
@rickam9055 5 жыл бұрын
You are the god of AI
@sanjeebsubedi2826
@sanjeebsubedi2826 3 жыл бұрын
t2.reshape(t2.shape[0], np.prod(t2.shape[1:]))
@gabe8168
@gabe8168 3 жыл бұрын
print(t.reshape(3, -1))
@ThomasRStevenson
@ThomasRStevenson 5 жыл бұрын
t = torch.stack((t1,t2,t3)).reshape(3,1,16).squeeze()
@Zagroseckt
@Zagroseckt Жыл бұрын
i've been watching these on headphones. untill this video.. Sudenly earthquake.. evedently my headphones have no base responce :p But my speakers can shake the hosue..
@kanthikiransirra7535
@kanthikiransirra7535 4 жыл бұрын
t.reshape(1,3,16)
@pradeepkumar-ew1ze
@pradeepkumar-ew1ze 4 жыл бұрын
t.flatten().reshape(3, 16).squeeze() ( sorry for being late to the party :P)
@mariaralucaduminica9916
@mariaralucaduminica9916 4 жыл бұрын
t.reshape(3,16)
@DanNovischi
@DanNovischi 5 жыл бұрын
t = t.reshape(dim, t.shape[0], 1, -1) t = t.squeeze()
@akshooter_5010
@akshooter_5010 4 жыл бұрын
t.reshape(t.flutten(start_dim=1).shap) ;)
@ShivamYadav-rx3hy
@ShivamYadav-rx3hy 5 жыл бұрын
T.reshape(1,-1)[1]
@alihatefi5694
@alihatefi5694 3 жыл бұрын
t.reshape(3,1,1,-1)
@mruduldhawley2730
@mruduldhawley2730 2 жыл бұрын
t.reshape(t.shape[0],int(t.numel()/t.shape[0])) this will work as well
@leminhhung151
@leminhhung151 4 жыл бұрын
t.reshape(3,1,1,-1).squeeze()
@sulemanrasheed1634
@sulemanrasheed1634 6 жыл бұрын
t = t.reshape(len(t), -1)
@chidambarjoshi3470
@chidambarjoshi3470 11 ай бұрын
t.reshape(1,-1)[1]
@theflippedbit
@theflippedbit 4 жыл бұрын
Damn, every time I see a video of yours it makes me feel bad as in why haven't I subscribed to your Patreon account yet. Such is the quality and effort made in every single frame in every video. Feels like stealing.
@gmarcial44
@gmarcial44 5 жыл бұрын
t.reshape(1,-1)[0]
@amaytrivedi
@amaytrivedi 5 жыл бұрын
reshaped_new_tensor = tensor_reshaped.reshape((1,-1))
@りょりょりょ-b6s
@りょりょりょ-b6s 4 жыл бұрын
Alghouth it's late, I am gonna post my answer. t.reshape( t.shape[0], -1 )
@rafail_fridman
@rafail_fridman 5 жыл бұрын
Can you please not include that loud bass sound when you type code? It's really hurts my ears when I watch you in my headphones :(
@deeplizard
@deeplizard 5 жыл бұрын
Hey Raphael - Sorry about that. It's pretty much in for this whole series. I'll consider removing it in future videos. Which brand of headphones are you using? In my headphones it sounds very low and soothing.
@floyd084
@floyd084 5 жыл бұрын
I've noticed the high bass in both my headphones and in my car. Your headphones may be lowering the bass.
@fardinsaboori8770
@fardinsaboori8770 3 жыл бұрын
t.reshape(1,-1)[0,:]
@baqerghezi1342
@baqerghezi1342 4 жыл бұрын
t.reshape(len(t[0]),-1)
@sanajaved4496
@sanajaved4496 2 жыл бұрын
t=t.reshape(t.shape[0],(torch.numel(t)//t.shape[0])).squeeze()
@andresalmodovar3473
@andresalmodovar3473 3 жыл бұрын
t.reshape(3,16)
@DeltaSleepy
@DeltaSleepy 5 жыл бұрын
t.reshape(3,-1)
@siddharthshrivastava5823
@siddharthshrivastava5823 5 жыл бұрын
t.reshape(t.shape[0],-1)
@harshtiwari9588
@harshtiwari9588 5 жыл бұрын
t.reshape(3,-1)
@sachit4
@sachit4 5 жыл бұрын
t.reshape(t.shape[0], -1)
@EunYeoWoo
@EunYeoWoo 5 жыл бұрын
t.reshape(3,-1)
@jonatan01i
@jonatan01i 5 жыл бұрын
t.reshape(t.shape[0], -1)
@mohammadwahiduzzamankhan4397
@mohammadwahiduzzamankhan4397 4 жыл бұрын
t.reshape(3,-1)
@vikhyatkumeria1229
@vikhyatkumeria1229 5 жыл бұрын
t.reshape(t.shape[0],-1)
@workhard7044
@workhard7044 4 жыл бұрын
t.reshape(3,-1)
@abhishekbhardwaj7214
@abhishekbhardwaj7214 4 жыл бұрын
t.reshape(t.shape[0], -1)
@jayachandra677
@jayachandra677 4 жыл бұрын
t.reshape(3,-1)
@sanskarram992
@sanskarram992 4 жыл бұрын
t.reshape(3,-1)
@PixelPulse168
@PixelPulse168 3 жыл бұрын
t.reshape(3,-1)
@sehaba9531
@sehaba9531 2 жыл бұрын
t.reshape(3,-1)
@LatpateShubhamManikrao
@LatpateShubhamManikrao 2 жыл бұрын
t.reshape(3, -1)
@prathameshdinkar2966
@prathameshdinkar2966 2 жыл бұрын
t.reshape(2,-1)
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
TensorFlow fundamentals: What are tensors in TensorFlow.js?
16:37
Google for Developers
Рет қаралды 9 М.
The moment we stopped understanding AI [AlexNet]
17:38
Welch Labs
Рет қаралды 1,4 МЛН
Dataset for Deep Learning - Fashion MNIST
16:04
deeplizard
Рет қаралды 29 М.
Code for Deep Learning - ArgMax and Reduction Tensor Ops
13:41
deeplizard
Рет қаралды 28 М.
Graph Neural Networks - a perspective from the ground up
14:28
But what is a convolution?
23:01
3Blue1Brown
Рет қаралды 2,8 МЛН
But what is a neural network? | Deep learning chapter 1
18:40
3Blue1Brown
Рет қаралды 18 МЛН
Creating PyTorch Tensors for Deep Learning - Best Options
11:02
deeplizard
Рет қаралды 37 М.
I built a 1,000,000,000 fps video camera to watch light move
29:08
AlphaPhoenix
Рет қаралды 555 М.