class_docstr: Training pipeline for the matrix factorization model with MLP layers instead of a final dot
  product (like in ``MatrixFactorizationModel``).
  
  ``MLPMatrixFactorizationModel`` models have an embedding layer for both users and items which,
  are concatenated and sent through a MLP to output a single float ranking value.
  
  All ``MLPMatrixFactorizationModel`` instances are subclasses of the ``LightningModule`` class
  provided by PyTorch Lightning. This means to train a model, you will need a
  ``collie.model.CollieTrainer`` object, but the model can be saved and loaded without this
  ``Trainer`` instance. Example usage may look like:
  
  .. code-block:: python
  
      from collie.model import CollieTrainer, MLPMatrixFactorizationModel
  
  
      model = MLPMatrixFactorizationModel(train=train)
      trainer = CollieTrainer(model)
      trainer.fit(model)
      model.eval()
  
      # do evaluation as normal with ``model``
  
      model.save_model(filename='model.pth')
      new_model = MLPMatrixFactorizationModel(load_model_path='model.pth')
  
      # do evaluation as normal with ``new_model``
  
  Parameters
  ----------
  embedding_dim: int
      Number of latent factors to use for user and item embeddings
  num_layers: int
      Number of MLP layers to apply. Each MLP layer will have its input dimension calculated with
      the formula ``embedding_dim * (2 ** (``num_layers`` - ``current_layer_number``))``
  dropout_p: float
      Probability of dropout on the linear layers
  bias_lr: float
      Bias terms learning rate. If 'infer', will set equal to ``lr``
  optimizer: torch.optim or str
      If a string, one of the following supported optimizers:
  
      * ``'sgd'`` (for ``torch.optim.SGD``)
  
      * ``'adam'`` (for ``torch.optim.Adam``)
  
  bias_optimizer: torch.optim or str
      Optimizer for the bias terms. This supports the same string options as ``optimizer``, with
      the addition of ``infer``, which will set the optimizer equal to ``optimizer``. If
      ``bias_optimizer`` is ``None``, only a single optimizer will be created for all model
      parameters
  y_range: tuple
      Specify as ``(min, max)`` to apply a sigmoid layer to the output score of the model to get
      predicted ratings within the range of ``min`` and ``max``
docstr: Method for building model internals that rely on the data passed in.
  
  This method will be called after `prepare_data`.
docstr_tok: ["Method","for","building","model","internals","that","rely","on","the","data","passed","in",".","This","method","will","be","called","after","`","prepare_data","`","."]
code: def _setup_model(self, **kwargs) -> None:
      """
      Method for building model internals that rely on the data passed in.
  
      This method will be called after `prepare_data`.
  
      """
      self.user_biases = ZeroEmbedding(
          num_embeddings=self.hparams.num_users, embedding_dim=1
      )
      self.item_biases = ZeroEmbedding(
          num_embeddings=self.hparams.num_items, embedding_dim=1
      )
      self.user_embeddings = ScaledEmbedding(
          num_embeddings=self.hparams.num_users,
          embedding_dim=self.hparams.embedding_dim,
      )
      self.item_embeddings = ScaledEmbedding(
          num_embeddings=self.hparams.num_items,
          embedding_dim=self.hparams.embedding_dim,
      )
  
      mlp_modules = []
      input_size = self.hparams.embedding_dim * 2
      for i in range(self.hparams.num_layers):
          next_input_size = int(
              self.hparams.embedding_dim
              * 2
              * (
                  (self.hparams.num_layers - i)
                  / (self.hparams.num_layers + 1)
              )
          )
          mlp_modules.append(nn.Linear(input_size, next_input_size))
          mlp_modules.append(nn.ReLU())
          mlp_modules.append(nn.Dropout(p=self.hparams.dropout_p))
          input_size = next_input_size
      self.mlp_layers = nn.Sequential(*mlp_modules)
  
      self.predict_layer = nn.Linear(next_input_size, 1)
  
file_path: collie/collie/model/mlp_matrix_factorization.py
imports: from functools import partial
  from typing import Callable, Dict, Optional, Tuple, Union
  import torch
  from torch import nn
  from torch.optim.lr_scheduler import ReduceLROnPlateau
  from collie.model.base import BasePipeline, INTERACTIONS_LIKE_INPUT, ScaledEmbedding, ZeroEmbedding
  from collie.utils import get_init_arguments, merge_docstrings
label_desc: Use image node_id 2 for calling the MLPMatrixFactorizationModel obj's underlying member method code with example usage: obj._setup_model() without return types