eb4ffb6cdaf6f04f978fc57e32c95c8b4a33bcb6,examples/federated_learning_with_encryption.py,Client,fit,#Client#,117
Before Change
//
// 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
After Change
for _ in range(n_iter):
for i in range(length):
delta = self.predict(X[i, :]) - y[i]
for j in range(dim):
self.weights[j] -= eta * delta * 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 compute_gradient(self, X, y):
// Return the gradient computed at the current model.
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: data61/python-paillier
Commit Name: eb4ffb6cdaf6f04f978fc57e32c95c8b4a33bcb6
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: iskandr/fancyimpute
Commit Name: 9439f5215fde61ee40910b0320ff4dd8d28571e2
Time: 2016-01-10
Author: alex.rubinsteyn@gmail.com
File Name: fancyimpute/bayesian_ridge_regression.py
Class Name: BayesianRidgeRegression
Method Name: fit
Project Name: pymanopt/pymanopt
Commit Name: a1be7bf2f0926707e25b02570c17ba373878f768
Time: 2016-03-14
Author: jamiehntownsend@gmail.com
File Name: pymanopt/manifolds/psd.py
Class Name: PositiveDefinite
Method Name: exp