by backpropaganda · 9y ago · 0 comments
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.
- 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.