I am developing a custom loss function in Keras and I need the first layer output.
How can I retrieve it?
def custom_loss(y_true, y_pred):
cross = K.mean(K.binary_crossentropy(y_true, y_pred), axis = 1)
layer_output = model.get_layer_output(1) # this is what i'd like to use
return cross + perturb