Not using a validation split is actually a pretty big difference. For some additional perspective, adding additional training examples is typically more beneficial than model architecture differences. You shouldn't use the split in TensorFlow if you want to make a comparison like this; even if you cite this reason.
@gowiththeflo592 жыл бұрын
Yea ditto this is actually a huge difference in the comparison
@aliawad2244 Жыл бұрын
exactly! I wonder why he did this since I was really intrigued to see the results :(
@loftyTHEOWNER Жыл бұрын
I don't see why the results should be different between the 2 if everything else is the same. After all, the math to compute the weight update is the same. I was much more interested in the speed comparison. But even for that, I think it would be better to try some larger models and run them multiple times using state of the art features, instead of just simple examples...
@williamsorenson15258 ай бұрын
@@loftyTHEOWNER Overfitting. The tensorflow model could learn the training data really well, but not be so good at the test data. If the validation data had a picture of a red car and there was no red car in the training data, then the model will get confused, as it may have overfitted and relied heavily on the color of the car. In general, you almost always want a validation split, as it catches the problem of overfitting early on.
@g.42797 ай бұрын
He didn't even control the order of the images being used for training, it is very different. You need averages and retraining to quantify performance.
@DHAtEnclaveForensics Жыл бұрын
The results are also different because the initialization of the weights and biases is random. Unless you make them identical you can never expect to get the same results.
@ai_minds_2 жыл бұрын
If you used all data for train torch model, there is no point to compare metrics + you should define random seed as well
@ogrp57772 жыл бұрын
Saying that PyTorch is better than TF by just looking at the results of one run? Deep learning models have a random component … so this result is completely lead by chance. When I see the title of the video, I thought the video was about doing a real comparison regarding usability, memory and GPU consumption, etc
@phoenix212 Жыл бұрын
I don't think this video meant to be a benchmark of the two frameworks, he literally said "performance wise both frameworks are on the same level"
@maxxel_ Жыл бұрын
i think you missed the point my guy
@yudzu88209 ай бұрын
It looks like this video was meant for newbies, who dont even know basics yet or even what cuda is. So no wonder, that this is only "oh look, how code looks"
@cristianpadurariu2 жыл бұрын
what about weight initialization? .... that could affect the performance pretty dramatically in some cases
@matteolacki45332 жыл бұрын
Precisely, running TF twice as well one will not end up with the same result unless one sets some fixed random seed.
@StaMariaRock Жыл бұрын
As a begginner, Tensorflow feels way easier, pytorch looks and feels like some deep engineering, I guess I might have to learn both. But I still prefer Tensorflow, feels like it available for everyone
@arnavpurushotamcomputerscience Жыл бұрын
yeah even i started off with tensorflow seeing how easy to use it was, but most research projects are implemented in pytorch. Since i had to analyze much open source research code during my projects, it was critical to know pytorch as well in addition to tensorflow
@loftyTHEOWNER Жыл бұрын
Now that ChatGPT can write all the code you need, I feel there is not much difference anymore. But for more complex stuff, I feel PyTorch become easier, because you don't need to go and modify the classes with some weird inheritances. I've just wrote some custom classes for learning rate schedule and early stopping in PyTorch and it completely felt like normal Python...
@rahulprasad23182 жыл бұрын
Comparing accuracy doesn't make sense here. 1st, initial weights are random. 2. Pytorch was trained on full train dataset. If anything this just shows tf is much much faster to get a model ready. Pytorch is only good if you are getting paid for finding new stuff.
@aminuroseline99042 жыл бұрын
He said the result could be skewed, it's not "could be" it was actually skewed, imagine doing this in type of comparison in a normal research!!
@patloeber2 жыл бұрын
yes, I mentioned that skills could be skewed and performance is on the same level. Showing the accuracy should mainly demonstrate that the loss and accuracy values lie in the same range :)
@dinoscheidt2 жыл бұрын
@@rogerab1792 and create a bunch of bugs along the way? PyTorch and Tensorflow are heavily tested and verified tools. Trusting you in your academic reasoning AND your engineering skills? Just no
@clairelesaffre249 Жыл бұрын
@@rogerab1792 I don't think it's VERY useful, I think it's fun. It's like recoding libc and C++ containers. They already exist but we recode it to prove something for ourselves. Not useful.
@fcbarca4949 Жыл бұрын
@patloeber Hi sir, can you kindly provide that pytorch and tensorflow code links in description?
@nicklam35942 жыл бұрын
No JIT/ mixed precision optimizations? Comparing the accuracy of the same model on different frameworks and not understanding that the difference is due to the randomness of the initialization? Weird video.
@lupsik12 жыл бұрын
Using all data without a validation split was the biggest factor in the difference. Given enough time and a simple task, those networks are very likely to still end up near the same local minima. But i agree that initializing all w&b to the same values would be cooler. Kind of a pity, i really wish i could see the experiment properly repeated
@prathameshdinkar2966 Жыл бұрын
Nice video! Just want to add at 2:09, there are 3 methods to create the tf model. I think you missed to mention functional API which is intermediate between Sequential and Subclassing
@peilanhsu2 ай бұрын
Thank you SO MUCH for making this video! I'm transitioning from TF to PyTorch and REALLY needed a "same model, both frameworks" video like this one!
@cloud_19922 жыл бұрын
What about training and evaluation time? Which has less value?
@christianherrera47292 жыл бұрын
I was thinking the same thing.
@robosergTV2 жыл бұрын
use ONNX format for serving, then it doesnt matter if its TF or PyTorch
@zoneofflow55562 жыл бұрын
Why didn't you include pytorch-lightning, as you have included keras for tensorflow? It would have been a better comparison, and in my usage lightning overthrows keras in terms of ease of usage. In this video, you did basically keras vs pytorch.
@CppExpedition2 жыл бұрын
He can't cover in depth everything in one video! Please be patient. Which framework do you like the most? i have the feeling that every single one is wrong
@VegetableJuiceFTW2 жыл бұрын
agree 100%
@robc17752 жыл бұрын
A KZbin comment section with well thought out intelligent comments, making valid arguments in favor and opposition! 🤯 Great input worth pondering!
@bediosoro77862 жыл бұрын
I think that you should have use model sequential in pytorch or use gratienttape approach in tensorflow for better comparison.
@parttimelarry2 жыл бұрын
Great video and editing, you covered a lot of ground in 13 minutes.
@patloeber2 жыл бұрын
thank you :)
@md.arrahmandip763810 ай бұрын
Hello there, how to setup both pytorch and tensorflow in same machine using one cuda toolkit? Or in different environment maintaining same cuda toolkit? Thank you.
@Imboredas2 жыл бұрын
As far as I’m concerned, the research community heavily favors pytorch these days, at least for the field I’m in (NLP). Mostly because of huggingface and fairseq I think 😂 Also, with tensorflow and Keras, even with the eager mode enabled, the error messages are not as helpful as pytorch. Another thing I like about torch is that everything inherits from nn.module, unlike in keras, where model and layer are two separate classes.
@harrytsang15012 жыл бұрын
TF is simpler for building well-researched models, and PyTorch has better data loader and lower level controls for the cutting edge. In my experience because torch tensor can be manually managed to be stored on CPU or co-processors, it can be significantly faster than TF when managed correctly. Newer versions of Nvidia’s VideoProcessingFramework even provides bindings for direct conversion between video and PyTorch Tensors on the GPU so working with video is real time
@doords2 жыл бұрын
Do you find pytorch to better for NLP projects? I got in with Pytorch because our engineers from Stanford are taught in it.
@Imboredas2 жыл бұрын
@@doords I would say so, just because most of the recent work that publish their code in open source are in PyTorch, except for google's papers (for obvious reasons). It's similar to recommending react. It's not that it is better than its competitors dramatically, but just that it is more popular in the community now, which means you can get more help, more established codebase / libraries, etc.
@doords2 жыл бұрын
@@Imboredas That is good know. By the way which online communities do you recommend in case we run into problems working on NLP projects.
@cipherxen2 Жыл бұрын
On one hand python programmers want to write less code, but here they want to write more code. How?
@maxxel_ Жыл бұрын
great vid, was cool for me to see how initializing and training a model in pytorch looks like
@wyctorfogos2322 жыл бұрын
Great video ! But only one observation: you must compare the models'creation using the Tensorflow in it's Advanced mode, because Pytorch ia based on Oriented object.
@karinwiberg22232 жыл бұрын
By another KZbin video I learned that Pytorch is more commonly used for Computer Vision and NPL than for "traditional" data (numbers, categories etc). What do you say about using Pytorch with traditional data?
@sumitmore6824 Жыл бұрын
Which software should I use for both ??
@datascience30082 жыл бұрын
In pytorch In the fully connected layer Why was it multiplied by 4*4
@juanete692 жыл бұрын
Can I use "crossentropy" as a metric as we also do for the loss?
@RohanPaul-AI2 жыл бұрын
Nice and clean presentation in 13 mints. Great video, Thank you.
@sergyyoubi37392 жыл бұрын
For a JavaScript Developer like me, Tensorflow/Keras is easier to learn bcz its syntax is almost the same as JS
@Bengt.Lueers2 жыл бұрын
You would be writing TensorFlow-style Python as if it were JavaScript?! Please don't.
@dezaku66122 жыл бұрын
@@Bengt.Lueers there is tensorflow.js I think that's what he meant
@LocNguyen-lb7ii2 жыл бұрын
I dont think performance test base on acc and loss is some what appropriate, because you didn't set a seed for python or random package so the initial state of neuron weight will be different, anw I still think this is a great video, thanks for your effort.
@iworeushankaonce2 жыл бұрын
Agree. CV, and averaging across multiple runs could've solved this issue.
@amrohendawi60072 жыл бұрын
Comparing two frameworks on different levels of abstraction is not a fair comparison.
@paul_devos2 жыл бұрын
Wow. Great video doing the side by side. Momentum and adoption seems to favor PyTorch and in general, many FB frameworks over Google frameworks. I could definitely see where if you're a very good Python developer (or want to be), PyTorch would be a very "easy" choice. TensorFlow seems very easy for the "incremental" command workflows that many Data Scientists do especially if they aren't really good with OOP. So in essence, TensorFlow feels a little bit like R for Stats, a "researcher first" tool... you get a ton of stuff just included, whereas with Python, you have to build and customize all your outputs, which feels more SWE driven than Researcher/Academic driven, e.g. like R.
@djangoworldwide79252 жыл бұрын
Does anyone even use R in the real world? It has a TF option as well
@Ahmed-ym7zi Жыл бұрын
Where can I see the full codes?
@Trepetsky10 ай бұрын
Jax, very flexible, but also fast, faster than PyTorch. And you can still run on TPU. Yes, now support for TPU has been added to PyTorch, but it was recently done, I tried it, it's still raw.
@farleylai11022 жыл бұрын
All the randomness needs to be under control: seeds for python and CUDA, weight initialization, optimizer and etc. How about another head to head benchmark on Apple M1 Pro/Max?
@bladesskate3954 Жыл бұрын
Which is better for a beginner?
@DrunkenUFOPilot8 ай бұрын
Flip a coin and go with it either way. Both have plenty of tutorials, Q&A forums, etc. and you can't go wrong with the one you choose. Just stick with it for long enough you can 'think' in it and have done a small project or demo worthy of showing others before diving into the other.
@magmyr Жыл бұрын
The answer, like with many other topics in computer science: it depends
@utubesuxman Жыл бұрын
Super helpful information and very clearly communicated
@shivamroy17752 жыл бұрын
Very informative and crisp video. Love the effort put into it. Keep up the good work !
@monisprabu11742 жыл бұрын
Thank you very much for this comparison !!!
@harshraj25752 жыл бұрын
With my little experience (mostly with torch), my opinion is biased but I felt torch is much more user friendly while debugging while tensorflow can give you hypertension at times.
@jeremyheng85732 жыл бұрын
Very good explanation
@Aishwarya_Varma212 жыл бұрын
Hi, Aishwarya here. I was looking around for data scientists and found your profile. Currently I am working on a 3D CT reconstruction project deploying tensorflow in it. I am facing a bit of errors in the code and unable to arrive at a result. Could you please help me with this rn if possible ?
@supervince1102 жыл бұрын
Tf was super confusing when they introduced 2.0
@codingcrashkurse64292 жыл бұрын
I think both are pretty good ;-)
@davidtindell9502 жыл бұрын
Good overview. TU. I employ both frameworks and often prototype on Apple Silicon as well as Intel ++ NVidea ... . . .
@md.musfiqurrahaman86122 жыл бұрын
Thanks man for this amazing tutorial...
@CppExpedition2 жыл бұрын
Possible the most relevant decision we do without knowing! ^_^
@eranfeit2 жыл бұрын
Very nice video. Thanks
@suleimankhader2 жыл бұрын
what about MLflow?
@ChrisHalden0072 жыл бұрын
Great video. Thanks!
@dustinwilliams4482 жыл бұрын
Thanks for all the great info.. not sure the results are meaningful , if you’re not doing a 1:1 test it’s not very informative
@bananaatss2 жыл бұрын
It could be the random seed
@dreamphoenix2 жыл бұрын
Thank you.
@Andr_e_y2 жыл бұрын
I haven't tried TF, I use Pytorch
@elyasaf7552 жыл бұрын
You should try TF.
@CppExpedition2 жыл бұрын
love learning by doing! love this channel!
@stayhappylittlemermaid2 жыл бұрын
If you are insecure, guess what? The rest of the world is, too. Do not overestimate the competition and underestimate yourself. You are better than you think.
@haroonrehman8156 Жыл бұрын
I miss your channel's previous name
@en-iyi-benim Жыл бұрын
what was it
@elyasaf7552 жыл бұрын
Tensorflow is much better and well polished imo
@maelstrom2542 жыл бұрын
It’s basically dead
@elyasaf7552 жыл бұрын
@@maelstrom254 you're trolling, right? xD
@maelstrom2542 жыл бұрын
@@elyasaf755 look at usage statistics. Plus I personally don’t know who would prefer Tensorflow (we have several floors of research department)
@sauravmayАй бұрын
The entire content and Speaking are done through AI voice and few screens are incorporated manually.....
@tilkesh5 ай бұрын
print('Thanks')
@leo.y.comprendo2 жыл бұрын
#TeamPytorch
@tljstewart2 жыл бұрын
Perfect!
@VegetableJuiceFTW2 жыл бұрын
this video was unfair and inconclusive
@davidademola3770 Жыл бұрын
Jesus Christ 😭🙆
@Raaj_ML3 ай бұрын
Are you taking a session or just reading out something ? Sorry...teaching is not reading out something fast like this !