def model_mixture(self, features,
                    params):
    """Jointly train four tasks.

    m_xxx stands for feature and label to train the set membership task.
    p_xxx stands for a pair of set to train intersection and union.
    f_xxx stands for features to train the follow operation.

    Args:
      features: features
      params: hyper-parameters

    Returns:
      predictions and losses
    """
    m_padded_ent_ids, m_labels, \
    p_candidate_set1, p_candidate_set2, p_union_labels, p_intersection_labels, \
    f_subject_set, f_relation_set, f_labels = features

    # Run model on the task of set membership.
    m_features = (m_padded_ent_ids, m_labels)
    m_loss, m_tensors = self.model_membership(m_features, params)

    # Run model on the task of intersection and union.
    p_features = (p_candidate_set1, p_candidate_set2, p_intersection_labels)
    p_intersection_loss, p_tensors = self.model_intersection(
        p_features, params)
    p_union_loss = self.compute_tf_loss(
        p_tensors['logits'], p_union_labels)

    # Run model on the task of set follow.
    f_features = (f_subject_set, f_relation_set, f_labels)
    f_loss, f_tensors = self.model_follow(f_features, params)

    loss = m_loss + p_intersection_loss + p_union_loss + f_loss
    tensors = dict()
    tensors['membership_logits'] = m_tensors['logits']
    tensors['membership_labels'] = m_labels
    tensors['intersection_logits'] = p_tensors['logits']
    tensors['intersection_labels'] = p_intersection_labels
    tensors['union_logits'] = p_tensors['logits']
    tensors['union_labels'] = p_union_labels
    tensors['set_follows_logits'] = f_tensors['logits']
    tensors['set_follows_labels'] = f_labels
    return loss, tensors
Jointly train four tasks.

    m_xxx stands for feature and label to train the set membership task.
    p_xxx stands for a pair of set to train intersection and union.
    f_xxx stands for features to train the follow operation.

    Args:
      features: features
      params: hyper-parameters

    Returns:
      predictions and losses
    
language/emql/model.py