class_docstr: This is the class with the general functions of the algorithm.
  
  For different fairness metrics, the objective function of the optimization
  problem is different and hence needs different implementations.
  The fairness-metric specific methods need to extend this class and implement
  the necessary functions.
class_docstr_tok: ["This","is","the","class","with","the","general","functions","of","the","algorithm",".","For","different","fairness","metrics",",","the","objective","function","of","the","optimization","problem","is","different","and","hence","needs","different","implementations",".","The","fairness-metric","specific","methods","need","to","extend","this","class","and","implement","the","necessary","functions","."]
docstr: Gradient Descent implementation for the optimizing the objective
  function.
  
  Note that one can alternately also use packages like CVXPY here.
  Here we use decaying step size. For certain objectives, constant step
  size might be better.
docstr_tok: ["Gradient","Descent","implementation","for","the","optimizing","the","objective","function",".","Note","that","one","can","alternately","also","use","packages","like","CVXPY","here",".","Here","we","use","decaying","step","size",".","For","certain","objectives",",","constant","step","size","might","be","better","."]
code: def gradientDescent(self, dist, a, b, samples, z_prior):
      """Gradient Descent implementation for the optimizing the objective
      function.
  
      Note that one can alternately also use packages like CVXPY here.
      Here we use decaying step size. For certain objectives, constant step
      size might be better.
      """
      min_val = np.inf  # 1e8
      min_param = None
      for i in range(1, 10):
          params = self.init_params(i)
          for k in range(1, 50):
              grad = self.getExpectedGrad(
                  dist, a, b, params, samples, 0.01, z_prior
              )
              for j in range(self.num_params):
                  params[j] = params[j] - 1 / k * grad[j]
              f_val = self.getFuncValue(
                  dist, a, b, params, samples, z_prior
              )
              if f_val < min_val:
                  min_val, min_param = f_val, params
      return min_param
  
file_path: AIF360/aif360/algorithms/inprocessing/celisMeta/General.py
imports: from abc import ABC, abstractmethod
  from functools import partial
  import numpy
  from scipy.stats import multivariate_normal
  from sklearn.metrics import accuracy_score
label_desc: Use image node_id 8 for calling the General obj's underlying member method code with example usage: obj.gradientDescent(dist, a, b, samples, z_prior) and returns: min_param