I want to implement center Loss explained in [http://ydwen.github.io/papers/WenECCV16.pdf] in Keras
I started to create a network with 2 outputs such as :
inputs = Input(shape=(100,100,3))
...
fc = Dense(100)(#previousLayer#)
softmax = Softmax(fc)
model = Model(input, output=[softmax, fc])
model.compile(optimizer='sgd',
loss=['categorical_crossentropy', 'center_loss'],
metrics=['accuracy'], loss_weights=[1., 0.2])
First of all, doing like this, is it the good way to proceed?
Secondly, I don't know how to implement the center_loss in keras. Center_loss looks like mean square error but instead of comparing values to fixed labels, it compares values to data updated at each iteration.
Thank you for your help