Hacker News new | ask | show | jobs
by jszymborski 1068 days ago
Keras and PyTorch! I thought I'd never see the day! Glad to see the two communities bury the hatchet.
1 comments

I don’t get it - why would you want Keras if you already use Pytorch?
The 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.

What’s so hard about writing a training loop?
nothing 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.
You 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.
It 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.
It's extremely easy to get wrong in subtle ways.
do you implement the sort function and the hash map from scratch every time you need them? If not, what's so hard about implementing a sorting algorithm?
Because sometimes you don’t want to write your own training loops, you just want a working method to train a model.
There are a lot of libraries for that. For example Pytorch Lightning, Accelerate are very mature
Sure, and Keras is another, very mature library which allows you to do this...
Keras + Pytorch is not mature.