def __init__(
    self,
    dataset,
    activation_fn,
    nDim,
    l2Lambda,
    l2NoteBiasMultiplier,
    l2RaterBiasMultiplier,
    l2GlobalBiasMultiplier,
    l2RaterReputationMultiplier,
    noteInitState: Optional[pd.DataFrame] = None,
    raterInitState: Optional[pd.DataFrame] = None,
    globalInterceptInit: Optional[float] = None,
    device=torch.device("cpu"),
    defaultReputation=1.0,
    ratingPerNoteLossRatio: Optional[float] = None,
    ratingPerUserLossRatio: Optional[float] = None,
  ):
    """
    noteInitState expects a df with columns:
      noteId, internalNoteIntercept, internalRaterFactor1
    raterInitState expects a df with columns:
      raterParticipantIdKey, internalRaterIntercept, internalRaterFactor1, internalRaterReputation

    For diligence model: may want to map these names back to internal before calling this function.
    """
    super().__init__()
    # Save hyperparameters
    self.activation_fn = activation_fn
    self.nDim = nDim
    self.l2Lambda = l2Lambda
    self.l2NoteBiasMultiplier = l2NoteBiasMultiplier
    self.l2RaterBiasMultiplier = l2RaterBiasMultiplier
    self.l2RaterReputationMultiplier = l2RaterReputationMultiplier
    self.l2GlobalBiasMultiplier = l2GlobalBiasMultiplier
    self.format = {"device": device, "dtype": torch.float32}
    # Create parameters
    self.noteEmbedding = nn.Embedding(dataset.notes.shape[0], self.nDim, **self.format)
    self.raterEmbedding = nn.Embedding(dataset.raters.shape[0], self.nDim, **self.format)
    self.noteBias = nn.Embedding(dataset.notes.shape[0], 1, **self.format)
    self.raterBias = nn.Embedding(dataset.raters.shape[0], 1, **self.format)
    self.raterReputation = nn.Embedding(dataset.raters.shape[0], 1, **self.format)
    self.raterReputation.weight = nn.Parameter(
      torch.ones(self.raterReputation.weight.shape[0], 1, **self.format) * defaultReputation
    )
    self._ratingPerNoteLossRatio = ratingPerNoteLossRatio
    self._ratingPerUserLossRatio = ratingPerUserLossRatio

    self.init_global_bias(globalInterceptInit)
    self.init_rater_factor(raterInitState, dataset, device, defaultValue=0.0)
    self.init_rater_intercept(raterInitState, dataset, device, defaultValue=0.0)
    self.init_rater_reputation(raterInitState, dataset, device, defaultValue=defaultReputation)
    self.init_note_factor(noteInitState, dataset, device, defaultValue=0.0)
    self.init_note_intercept(noteInitState, dataset, device, defaultValue=0.0)

    noteInitState expects a df with columns:
      noteId, internalNoteIntercept, internalRaterFactor1
    raterInitState expects a df with columns:
      raterParticipantIdKey, internalRaterIntercept, internalRaterFactor1, internalRaterReputation

    For diligence model: may want to map these names back to internal before calling this function.
    
sourcecode/scoring/reputation_matrix_factorization/reputation_matrix_factorization.py