in torchbiggraph/config.py [0:0]
def __attrs_post_init__(self) -> None:
for rel_id, rel_config in enumerate(self.relations):
if rel_config.lhs not in self.entities:
raise ValueError(
"Relation type %s (#%d) has an unknown "
"left-hand side entity type %s"
% (rel_config.name, rel_id, rel_config.lhs)
)
if rel_config.rhs not in self.entities:
raise ValueError(
"Relation type %s (#%d) has an unknown "
"right-hand side entity type %s"
% (rel_config.name, rel_id, rel_config.rhs)
)
if self.dynamic_relations:
if len(self.relations) != 1:
raise ValueError(
"When dynamic relations are in use only one "
"relation type must be defined."
)
# TODO Check that all partitioned entity types have the same number of
# partitions
# TODO Check that the batch size is a multiple of the batch negative number
if self.loss_fn == "logistic" and self.comparator == "cos":
logger.warning("You have logistic loss and cosine distance. Are you sure?")
if self.disable_lhs_negs and self.disable_rhs_negs:
raise ValueError("Cannot disable negative sampling on both sides.")
if self.background_io:
logger.warning("`background_io` is deprecated and will have no effect.")