def apply_optimization(self, update_embedding_with, grad, **kwargs):
if self.linesearch:<EOL><INDENT>return self._apply_linesearch_optimzation(update_embedding_with,<EOL>grad, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>return self._apply_fixed_optimization(update_embedding_with,<EOL>grad, **kwargs)<EOL><DEDENT>
Calculating (Obtaining) the learning rate (eta) and apply optimizations
on the embedding states by the specified method.

Parameters
----------
update_embedding_with : function
    Function used to update the state of RiemannianRelaxation
    class (Y or S).

grad : (n x s) array
    Gradients used in updating the embedding.

calc_loss : function (used by its child function)
    Function used to calculated the loss from the temperary state of
    RiemannianRelaxation instance. (YT or ST)

loss : float (used by its child function)
    Loss of the current state of RiemannianRelaxation instance.