def METHOD_NAME(self, train_set, val_set=None):
    """Fit the model to observations.
    Parameters
    ----------
    train_set: :obj:`cornac.data.Dataset`, required
        User-Item preference data as well as additional modalities.
    val_set: :obj:`cornac.data.Dataset`, optional, default: None
        User-Item preference data for model selection purposes (e.g., early stopping).
    Returns
    -------
    self : object
    """
    Recommender.METHOD_NAME(self, train_set, val_set)
    if self.trainable:
        if not hasattr(self, "graph"):
            self.num_users = self.train_set.num_users
            self.num_items = self.train_set.num_items
            self._build_graph()
        self._fit_tf()
    return self