diff --git a/README.md b/README.md index 935ee42..299d42d 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ for input_i in dataset: loss_i.backward() grads.append(get_gradient_vector(network)) #get loss-specfic gradient g_config=ConFIG_update(grads) # calculate the conflict-free direction - apply_gradient_vector(network) # set the condlict-free direction to the network + apply_gradient_vector(network,g_config) # set the condlict-free direction to the network optimizer.step() ``` diff --git a/conflictfree/grad_operator.py b/conflictfree/grad_operator.py index 1382bf5..7700c53 100644 --- a/conflictfree/grad_operator.py +++ b/conflictfree/grad_operator.py @@ -45,7 +45,7 @@ def ConFIG_update_double( loss_i.backward() grads.append(get_gradient_vector(network)) #get loss-specfic gradient g_config=ConFIG_update_double(grads) # calculate the conflict-free direction - apply_gradient_vector(network) # set the condlict-free direction to the network + apply_gradient_vector(network,g_config) # set the condlict-free direction to the network optimizer.step() ``` @@ -119,7 +119,7 @@ def ConFIG_update( loss_i.backward() grads.append(get_gradient_vector(network)) #get loss-specfic gradient g_config=ConFIG_update(grads) # calculate the conflict-free direction - apply_gradient_vector(network) # set the condlict-free direction to the network + apply_gradient_vector(network,g_config) # set the condlict-free direction to the network optimizer.step() ``` """ @@ -231,7 +231,7 @@ class ConFIGOperator(GradientOperator): loss_i.backward() grads.append(get_gradient_vector(network)) g_config=operator.calculate_gradient(grads) # calculate the conflict-free direction - apply_gradient_vector(network) # or simply use `operator.update_gradient(network,grads)` to calculate and set the condlict-free direction to the network + apply_gradient_vector(network,g_config) # or simply use `operator.update_gradient(network,grads)` to calculate and set the condlict-free direction to the network optimizer.step() ``` diff --git a/conflictfree/momentum_operator.py b/conflictfree/momentum_operator.py index b78ab5e..affda8c 100644 --- a/conflictfree/momentum_operator.py +++ b/conflictfree/momentum_operator.py @@ -171,7 +171,7 @@ class PseudoMomentumOperator(MomentumOperator): loss_i.backward() grads.append(get_gradient_vector(network)) g_config=operator.calculate_gradient(grads) # calculate the conflict-free direction - apply_gradient_vector(network) # or simply use `operator.update_gradient(network,grads)` to calculate and set the condlict-free direction to the network + apply_gradient_vector(network,g_config) # or simply use `operator.update_gradient(network,grads)` to calculate and set the condlict-free direction to the network optimizer.step() ``` """ diff --git a/docs/start/start.md b/docs/start/start.md index 967ea9a..2d0a866 100644 --- a/docs/start/start.md +++ b/docs/start/start.md @@ -36,7 +36,7 @@ for input_i in dataset: loss_i.backward() grads.append(get_gradient_vector(network)) #get loss-specfic gradient g_config=ConFIG_update(grads) # calculate the conflict-free direction - apply_gradient_vector(network) # set the condlict-free direction to the network + apply_gradient_vector(network,g_config) # set the condlict-free direction to the network optimizer.step() ``` @@ -55,7 +55,7 @@ for input_i in dataset: loss_i.backward() grads.append(get_gradient_vector(network)) g_config=operator.calculate_gradient(grads) # calculate the conflict-free direction - apply_gradient_vector(network) # or simply use `operator.update_gradient(network,grads)` to calculate and set the condlict-free direction to the network + apply_gradient_vector(network,g_config) # or simply use `operator.update_gradient(network,grads)` to calculate and set the condlict-free direction to the network optimizer.step() ``` @@ -78,7 +78,7 @@ for input_i in dataset: loss_i.backward() grads.append(get_gradient_vector(network)) g_config=operator.calculate_gradient(grads) # calculate the conflict-free direction - apply_gradient_vector(network) # or simply use `operator.update_gradient(network,grads)` to calculate and set the condlict-free direction to the network + apply_gradient_vector(network,g_config) # or simply use `operator.update_gradient(network,grads)` to calculate and set the condlict-free direction to the network optimizer.step() ``` diff --git a/pypi_desc.md b/pypi_desc.md index 80fcc8a..680fcc0 100644 --- a/pypi_desc.md +++ b/pypi_desc.md @@ -103,7 +103,7 @@ for input_i in dataset: loss_i.backward() grads.append(get_gradient_vector(network)) #get loss-specfic gradient g_config=ConFIG_update(grads) # calculate the conflict-free direction - apply_gradient_vector(network) # set the condlict-free direction to the network + apply_gradient_vector(network,g_config) # set the condlict-free direction to the network optimizer.step() ```