4 ms·
1. Still no support for multiple losses. Models like VAEs cannot be idiomatically implemented. The second loss has to be 'hacked' in. Notice how in the official
by backpropaganda 10y ago
1. Still no support for multiple losses. Models like VAEs cannot be idiomatically implemented. The second loss has to be 'hacked' in. Notice how in the official example for VAE, the kl_loss is computed using variables which are NOT available via the loss function (https://github.com/fchollet/keras/blob/master/examples/variational_autoencoder.py#L46 https://github.com/fchollet/keras/blob/master/examples/varia...)
2. It's still an input->output paradigm, rather than a {input, output}->loss paradigm which gives more flexibility.
These two issues are the main reason why I stick to slightly lower level APIs, even though I _want_ to use Keras.
- kortex 10y agoStrongly seconded. There are a lot of things I am tinkering with where I would love to have more fine-tuned control over loss, and have to resort to various hackery to get a mediocre approximation of my real idea.
- fchollet 10y agoSee the release notes: https://github.com/fchollet/keras/wiki/Keras-2.0-release-notes https://github.com/fchollet/keras/wiki/Keras-2.0-release-not... - You can use a Keras model to compute some tensor(s), turn that into a loss, and manually add that loss to the model via `add_loss` (it just needs to only depend on the model's inputs). - Not all of your model outputs have to have a loss associated with them. So you can do both {input, output}->loss and input->output in your workflow, as you wish. Effectively, losses and outputs are decoupled. The VAE example hasn't yet been updated to use the `add_loss` feature, but it should be.
- andrew3726 10y agoI will look into updating the VAE example, as I've ported the example to the keras 2.0 API recently. There is currently no documentation on add_loss as far as I can see, so I will have to try a few things.