class_docstr: Sensitive Subspace Robustness (SenSR).
  
  SenSR is an in-processing method for individual fairness which enforces
  performance invariance under certain sensitive perturbations to the input
  [#yurochkin19]_.
  
  References:
      .. [#yurochkin19] `M. Yurochkin, A. Bower, and Y. Sun, "Training
         individually fair ML models with sensitive subspace robustness."
         International Conference on Learning Representations, 2020.
         <https://arxiv.org/abs/1907.00020>`_
  
  See also:
      :class:`inFairness.fairalgo.SenSR`
  
  Attributes:
      regression_ (bool): Whether or not this task is treated as regression.
      classes_ (array, shape (n_classes,)): A list of class labels known to
          the transformer. Only present if ``self.regression_`` is False and
          y is provided to ``fit``.
      module_ (inFairness.fairalgo.SenSR): The fair PyTorch module.
class_docstr_tok: ["Sensitive","Subspace","Robustness","(","SenSR",")",".","SenSR","is","an","in-processing","method","for","individual","fairness","which","enforces","performance","invariance","under","certain","sensitive","perturbations","to","the","input","[","#","yurochkin19","]","_.","References",":","..","[","#","yurochkin19","]","`","M.","Yurochkin",",","A.","Bower",",","and","Y",".","Sun",",","``","Training","individually","fair","ML","models","with","sensitive","subspace","robustness",".","''","International","Conference","on","Learning","Representations",",","2020",".","<","https",":","\/\/arxiv.org\/abs\/1907.00020",">","`","_","See","also",":",":","class",":","`","inFairness.fairalgo.SenSR","`","Attributes",":","regression_","(","bool",")",":","Whether","or","not","this","task","is","treated","as","regression",".","classes_","(","array",",","shape","(","n_classes",",",")",")",":","A","list","of","class","labels","known","to","the","transformer",".","Only","present","if","``","self.regression_","``","is","False","and","y","is","provided","to","``","fit","``",".","module_","(","inFairness.fairalgo.SenSR",")",":","The","fair","PyTorch","module","."]
docstr: Args:
      module (torch.nn.Module): Network architecture.
      criterion (torch.nn.Module): Loss function.
      distance_x (inFairness.distances.Distance): Distance metric in the
          input space.
      eps (float): :math:`\epsilon` parameter in the SenSR algorithm.
      lr_lamb (float): :math:`\lambda` parameter in the SenSR algorithm.
      lr_param (float): :math:`\alpha` parameter in the SenSR algorithm.
      auditor_nsteps (int): Number of update steps for the auditor to find
          worst-case examples
      auditor_lr (float): Learning rate for the auditor.
      regression (bool or 'auto'): Task is regression. If 'auto', this is
          inferred using :func:`sklearn.utils.multiclass.type_of_target`
          on y in fit(). If a Dataset is provided to fit, this defaults to
          False. If y contains 'soft' targets (i.e. probabilities per
          class), this should be manually set to False.
      train_split (callable, optional): See :class:`skorch.net.NeuralNet`.
          Note: validation loss *does not* include any fairness loss, only
          the provided criterion, and should not be used for early
          stopping, etc. Default is None (no split).
      **kwargs: See :class:`skorch.net.NeuralNet`.
docstr_tok: ["Args",":","module","(","torch.nn.Module",")",":","Network","architecture",".","criterion","(","torch.nn.Module",")",":","Loss","function",".","distance_x","(","inFairness.distances.Distance",")",":","Distance","metric","in","the","input","space",".","eps","(","float",")",":",":","math",":","`","\\epsilon","`","parameter","in","the","SenSR","algorithm",".","lr_lamb","(","float",")",":",":","math",":","`","\\lambda","`","parameter","in","the","SenSR","algorithm",".","lr_param","(","float",")",":",":","math",":","`","\\alpha","`","parameter","in","the","SenSR","algorithm",".","auditor_nsteps","(","int",")",":","Number","of","update","steps","for","the","auditor","to","find","worst-case","examples","auditor_lr","(","float",")",":","Learning","rate","for","the","auditor",".","regression","(","bool","or","'auto","'",")",":","Task","is","regression",".","If","'auto","'",",","this","is","inferred","using",":","func",":","`","sklearn.utils.multiclass.type_of_target","`","on","y","in","fit","(",")",".","If","a","Dataset","is","provided","to","fit",",","this","defaults","to","False",".","If","y","contains","'soft","'","targets","(","i.e",".","probabilities","per","class",")",",","this","should","be","manually","set","to","False",".","train_split","(","callable",",","optional",")",":","See",":","class",":","`","skorch.net.NeuralNet","`",".","Note",":","validation","loss","*","does","not","*","include","any","fairness","loss",",","only","the","provided","criterion",",","and","should","not","be","used","for","early","stopping",",","etc",".","Default","is","None","(","no","split",")",".","*","*","kwargs",":","See",":","class",":","`","skorch.net.NeuralNet","`","."]
code: def __init__(
      self,
      module,
      *,
      criterion,
      distance_x,
      eps,
      lr_lamb,
      lr_param,
      auditor_nsteps,
      auditor_lr,
      regression="auto",
      **kwargs,
  ):
      """
      Args:
          module (torch.nn.Module): Network architecture.
          criterion (torch.nn.Module): Loss function.
          distance_x (inFairness.distances.Distance): Distance metric in the
              input space.
          eps (float): :math:`\epsilon` parameter in the SenSR algorithm.
          lr_lamb (float): :math:`\lambda` parameter in the SenSR algorithm.
          lr_param (float): :math:`\\alpha` parameter in the SenSR algorithm.
          auditor_nsteps (int): Number of update steps for the auditor to find
              worst-case examples
          auditor_lr (float): Learning rate for the auditor.
          regression (bool or 'auto'): Task is regression. If 'auto', this is
              inferred using :func:`sklearn.utils.multiclass.type_of_target`
              on y in fit(). If a Dataset is provided to fit, this defaults to
              False. If y contains 'soft' targets (i.e. probabilities per
              class), this should be manually set to False.
          train_split (callable, optional): See :class:`skorch.net.NeuralNet`.
              Note: validation loss *does not* include any fairness loss, only
              the provided criterion, and should not be used for early
              stopping, etc. Default is None (no split).
          **kwargs: See :class:`skorch.net.NeuralNet`.
      """
      self.distance_x = distance_x
      self.eps = eps
      self.lr_lamb = lr_lamb
      self.lr_param = lr_param
      self.auditor_nsteps = auditor_nsteps
      self.auditor_lr = auditor_lr
  
      super().__init__(
          module=module,
          criterion=criterion,
          regression=regression,
          **kwargs,
      )
  
imports: from inFairness import fairalgo
  from sklearn.preprocessing import LabelBinarizer
  from sklearn.utils.multiclass import type_of_target
  from sklearn.exceptions import NotFittedError
  from skorch import NeuralNet
  from skorch.dataset import unpack_data, Dataset
  from skorch.utils import is_pandas_ndframe
label_desc: Use image node_id 1 to create a new SenSR object from inherited base classes: InFairnessNet with example: obj = SenSR(module)