Support for additional inputs (constants) to the network in the default trainer
When you construct a structure with Keras, you need to feed one flag to the session during training and evaluation. I wonder if we can add the support for this built-in. Take a look at here to learn about Keras generally: https://blog.keras.io/keras-as-a-simplified-interface-to-tensorflow-tutorial.html The training is usually done like this:
train_step.run(feed_dict={img: batch[0],
labels: batch[1],
keras.backend.learning_phase(): 1})
basically you need to set keras.backend.learning_phase()
to 1
during training and 0
during evaluation.
This changes the behavior of batch normalization and dropout layers for example.
What do you think?