secure_learning.solvers.gd_solver module

Class for the gradient descent method

class secure_learning.solvers.gd_solver.GD[source]

Bases: Solver

Class for the gradient descent method

__init__()[source]

Constructor method.

inner_loop_calculation(X, y, coef_old, epoch)[source]

Performs one inner-loop iteration for the solver. Inner-loop refers to iteratively looping through the data in batches rather than looping over the complete data multiple times.

Parameters:
  • X (List[List[SecureFixedPoint]]) – Independent data

  • y (List[SecureFixedPoint]) – Dependent data

  • coef_old (List[SecureFixedPoint]) – Current iterative solution

  • epoch (int) – Number of times that the outer loop has completed

Return type:

List[SecureFixedPoint]

Returns:

Updated iterative solution

name: str = 'GD'
preprocessing(X_init, y_init)[source]

Preprocess obtained data.

May include centering and scaling.

Parameters:
  • X_init (List[List[SecureFixedPoint]]) – Independent data

  • y_init (List[SecureFixedPoint]) – Dependent data

Return type:

Tuple[List[List[SecureFixedPoint]], List[SecureFixedPoint]]

Returns:

Preprocessed independent and dependent data