title: How to use categorical_hinge loss in keras in order to train with an SVM in the last layer?
body: <p>I wanna train a CNN using SVM to classify at the last layer. I understand that the categorical_hinge is the best loss function for that . I have 6 classes to classify .
  My model is as shown below:</p>
  
  <pre><code>model = Sequential()    
  model.add(Conv2D(50, 3, 3, activation = 'relu', input_shape = train_data.shape[1:]))
  model.add(MaxPooling2D(pool_size=(2, 2)))
  model.add(Conv2D(50, 3, 3, activation = 'relu'))
  model.add(MaxPooling2D(pool_size=(2, 2)))
  model.add(Conv2D(50, 3, 3, activation = 'relu'))
  
  model.add(Flatten())
  model.add(Dense(400, activation = 'relu'))
  model.add(Dropout(0.5))
  model.add(Dense(128, activation = 'relu'))
  model.add(Dropout(0.5))
  model.add(Dense(1, activation = 'sigmoid'))
  </code></pre>
  
  <p>Is there a problem with the network , data processing , or the loss function?</p>
  
  <p>The model does not learn anything after a point as shown in the <a href="https://i.stack.imgur.com/OBOIK.png" rel="nofollow noreferrer">image</a>
  What should I do?</p>