We solve this via gradient descent with the gradient In special cases more efficient schemes are applicable.
it is well-known that if w f e 1 ,e 2 = 0 for all f the optimal solution is given by re-normalizing the coefficients c f e 1 ,e 2 .