KGATE 0.2.7__tar.gz → 0.2.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: KGATE
3
- Version: 0.2.7
3
+ Version: 0.2.9
4
4
  Summary: Knowledge Graph Autoencoder Training Environment, bridging PyG encoders and TorchKGE decoders.
5
5
  License: MIT
6
6
  Keywords: Knowledge Graph,Knowledge Graph Embedding,Autoencoder,Machine Learning,Link Prediction
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "KGATE"
3
- version = "0.2.7"
3
+ version = "0.2.9"
4
4
  description = "Knowledge Graph Autoencoder Training Environment, bridging PyG encoders and TorchKGE decoders."
5
5
  authors = [
6
6
  {name = "Benjamin Loire", email = "benjamin.loire@univ-amu.fr"},
@@ -101,7 +101,10 @@ class KnowledgeGraph(Dataset):
101
101
 
102
102
  if df is None:
103
103
  self.n_nodes = cat([self.head_idx, self.tail_idx]).unique().size(0)
104
- self.node_types = torch.zeros(self.n_ent, dtype=torch.long)
104
+ # The mapping is done on the absolute index of nodes. However, subgraphs don't have all the nodes
105
+ # Thus, we must initialize the tensor at -1 to avoid downstream issue with the node_type 0 being
106
+ # broadcasted to missing nodes in subgraphs.
107
+ self.node_types = torch.ones(self.n_nodes, dtype=torch.long).neg()
105
108
 
106
109
  for tri_type in self.triples.unique():
107
110
  h_t, t_t = self.triple_types[tri_type][0], self.triple_types[tri_type][2]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -581,9 +581,7 @@ class Architect(Model):
581
581
 
582
582
  trainer.add_event_handler(Events.EPOCH_COMPLETED, self.log_metrics_to_csv)
583
583
  trainer.add_event_handler(Events.EPOCH_COMPLETED, self.clean_memory)
584
- trainer.add_event_handler(Events.EPOCH_COMPLETED(every=self.eval_interval), self.evaluate)
585
584
  trainer.add_event_handler(Events.EPOCH_COMPLETED, self.update_scheduler)
586
- trainer.add_event_handler(Events.EPOCH_COMPLETED(every=self.eval_interval), early_stopping)
587
585
 
588
586
  trainer.add_event_handler(Events.COMPLETED, self.on_training_completed)
589
587
 
@@ -640,6 +638,8 @@ class Architect(Model):
640
638
  atomic=True
641
639
  )
642
640
 
641
+ trainer.add_event_handler(Events.EPOCH_COMPLETED(every=self.eval_interval), self.evaluate)
642
+ trainer.add_event_handler(Events.EPOCH_COMPLETED(every=self.eval_interval), early_stopping)
643
643
  trainer.add_event_handler(
644
644
  Events.EPOCH_COMPLETED(every=self.eval_interval),
645
645
  checkpoint_best_handler,
File without changes
File without changes
File without changes