def get_Gt(u, gradf, t):
# vector used for backtracking check with projected gradient descent
u_n = u - t * gradf;
norm_u_n = norm(u_n);
if (norm_u_n > 1.0): # project to L2 unit ball
u_norm = u_n / norm_u_n;
else:
u_norm = u_n;
Gt = 1.0/t * (u - u_norm);
return Gt
###################################################
## DCA_ONE STOCH - STOCHASTIC GRADIENT DESCENT ##
###################################################
评论列表
文章目录