3 ms·
I don’t get it - why would you want Keras if you already use Pytorch?
by p1esk 3y ago
I don’t get it - why would you want Keras if you already use Pytorch?
- pilotneko 3y agoBecause sometimes you don’t want to write your own training loops, you just want a working method to train a model.
- thangngoc89 3y agoThere are a lot of libraries for that. For example Pytorch Lightning, Accelerate are very mature
- jszymborski 3y agoSure, and Keras is another, very mature library which allows you to do this...
- p1esk 3y agoKeras + Pytorch is not mature.
- jszymborski 3y agoThe same reason why you might want to use Keras if you use any of the other backends. They operate at different levels. Keras is a higher-level API. It means that you can prototype architectures quickly and you don't have to write a training loop. It's also really easy to extend. I currently use PyTorch Lightning to avoid having to write tonnes of boilerplate code, but I've been looking for a way to leave it for ages as I'm not a huge fan of the direction of the product. Keras seems like it might be the answer for me.
- p1esk 3y agoWhat’s so hard about writing a training loop?
- minimaxir 3y agoIt's extremely easy to get wrong in subtle ways.
- rasmus1610 3y agonothing is. but to write a basic training loop with proper logging etc. from scratch every time you want to train a basic neural net classifier seems inefficient to me. There should be a framework for it where you can just plug in your model and your data and it trains it in a supervised fashion. That's what fast.ai or keras are doing.
- p1esk 3y agoYou only need to write a training loop function once. Then you can just pass to it a model, dataloader, etc, just like you would if you used a training loop written by someone else in Keras. The only difference is it would be hidden from you behind layers of wrappers and abstraction, making it harder to modify and debug.
- jszymborski 3y agoIt sounds like you've found something that works best for you, and that the large Keras user base has found something that works best for them.
- p1esk 3y agoThe large Keras userbase exists largely because Tensorflow sucked.
- jszymborski 3y agoI'll agree to disagree. I find great value in the Keras API. It's also a bit histrionic, in that Keras was very popular with the Theano backend before that project wound down.