MCPcopy Create free account
hub / github.com/apache/singa / update

Method update

python/singa/opt.py:738–746  ·  view source on GitHub ↗

Performs a single optimization step. Args: param(Tensor): param values to be update grad(Tensor): param gradients

(self, param, grad)

Source from the content-addressed store, hash-verified

736 self.backward_and_update(loss)
737
738 def update(self, param, grad):
739 """Performs a single optimization step.
740
741 Args:
742 param(Tensor): param values to be update
743 grad(Tensor): param gradients
744 """
745 grad /= self.world_size
746 self.opt.update(param, grad)
747
748 def all_reduce(self, tensor):
749 """Performs all reduce of a tensor for distributed training.

Callers 13

backward_and_updateMethod · 0.95
get_paramsMethod · 0.45
get_statesMethod · 0.45
test_dist_opt_fp32Method · 0.45
test_dist_opt_fp16Method · 0.45

Calls

no outgoing calls

Tested by 6

test_dist_opt_fp32Method · 0.36
test_dist_opt_fp16Method · 0.36