/// <summary>
 /// Calculate the loss/error of the output nodes.
 /// </summary>
 /// <param name="layer">the output layer</param>
 /// <returns>a vector containing the errors</returns>
 public static Vector OutputLoss(Layer layer, Vector desired, LossFunction f)
 {
     return(new Vector(VectorMath.ElementWiseOperation(layer.Nodes.Values, desired.Values, (a, b) => f(a, b))));
 }