103e31b4a2518797606d3b93440740df0532770d,examples/federated_learning_with_encryption.py,Client,fit,#Client#Any#Any#,124
Before Change
length = self.X.shape[0]
for _ in range(n_iter):
for i in range(length):
delta = self.predict(self.X[i, :]) - self.y[i]
for j in range(self.dim):
self.weights[j] -= eta * delta * self.X[i, j]
// print("Error %.4f" % mean_square_error(self.predict(X), y))
// self.weights = np.linalg.inv(X.T.dot(X)).dot(X.T).dot(y)
// print(self.weights)
return self
def gradient_step(self, gradient, eta=0.01):
Update the model with the given gradient
After Change
Linear regression for n_iter
for _ in range(n_iter):
gradient = self.compute_gradient()
self.gradient_step(gradient, eta)
def gradient_step(self, gradient, eta=0.01):
Update the model with the given gradient
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances Project Name: data61/python-paillier
Commit Name: 103e31b4a2518797606d3b93440740df0532770d
Time: 2017-06-20
Author: giorgio.patrini@anu.edu.au
File Name: examples/federated_learning_with_encryption.py
Class Name: Client
Method Name: fit
Project Name: tensorflow/tensorflow
Commit Name: e818c9e626fc5c95516e68fb2282f07d0232eea9
Time: 2020-11-18
Author: gardener@tensorflow.org
File Name: tensorflow/python/kernel_tests/relu_op_test.py
Class Name: ReluTest
Method Name: testGradientFloat16
Project Name: tensorflow/tensorflow
Commit Name: 1427bfc12ec5a3a2c6a4ffd57fc5b465d3eedfae
Time: 2020-11-19
Author: gardener@tensorflow.org
File Name: tensorflow/python/kernel_tests/relu_op_test.py
Class Name: ReluTest
Method Name: testGradientFloat16