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
- 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 datay (
List
[SecureFixedPoint
]) – Dependent datacoef_old (
List
[SecureFixedPoint
]) – Current iterative solutionepoch (
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 datay_init (
List
[SecureFixedPoint
]) – Dependent data
- Return type:
Tuple
[List
[List
[SecureFixedPoint
]],List
[SecureFixedPoint
]]- Returns:
Preprocessed independent and dependent data