转成matlab:self.eta = self.eta_max if kwargs.get('first_iter',False) and not self.linesearch_first: self.eta = kwargs.get('eta_first',1) loss_diff = 1 while loss_diff > 0: loss_diff, temp_embedding, delta = self._linesearch_once( update_embedding_with,grad,calc_loss,loss,**kwargs) if self.eta <= self.eta_min and loss_diff > 0: loss_diff, temp_embedding, delta = self._linesearch_once( update_embedding_with,grad,calc_loss,loss,**kwargs) loss_diff = -1 self.eta *= 2 update_embedding_with(new_embedding=temp_embedding) return delta
时间: 2023-07-15 12:11:16 浏览: 170
ETA6002.zip_ETA6002_eta6002 发热_eta6002 问题
self.eta = self.eta_max;
if isfield(kwargs,'first_iter') && kwargs.first_iter && ~self.linesearch_first
self.eta = kwargs.eta_first;
end
loss_diff = 1;
while loss_diff > 0
[loss_diff, temp_embedding, delta] = self._linesearch_once(update_embedding_with,grad,calc_loss,loss,kwargs);
if self.eta <= self.eta_min && loss_diff > 0
[loss_diff, temp_embedding, delta] = self._linesearch_once(update_embedding_with,grad,calc_loss,loss,kwargs);
loss_diff = -1;
end
end
self.eta = self.eta * 2;
update_embedding_with('new_embedding',temp_embedding);
end_return = delta;
阅读全文