title: keras flow and backpropagation
body: <p>I cannot find anywhere how exactly is backpropagation done in Keras? Let me explain:</p>
  
  <p>Lets say i have network</p>
  
  <pre><code>input = Input(shape=(X,X,Y))
  x = Conv2D(32,(3,3),padding="same")(input)
  x = Conv2D(64,(3,3),padding="same")(x)
  x = Conv2D(128,(3,3),padding="same")(x)
  x = Conv2D(64,(3,3),padding="same")(x)
  Output = Flatten(1024)(x)
  Output = Flatten(6)(Output)
  model = Model(input,Output)
  model.compile(loss="mean_squared_error", optimizer=keras.optimizers.Adam(),metrics=['accuracy'])
  model.fit(trainingData,trainingLabels)
  </code></pre>
  
  <p>The output of last layer is compared to <code>trainingLabels</code>, <code>mean squared error</code> is computed and Backpropagation happens based on the value of <code>mean squaed error</code></p>
  
  <p>However, what if i wanted to something more. And for example I want to try every permutation of output vector, and the one that results in minimal <code>mean squared error</code> should be treated as output, thus Backpropagation happens based on permutation with least error.</p>
  
  <p>Is something like this possible in Keras? If so, how can i achieve it</p>