tmnt 0.7.49__tar.gz → 0.7.50__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.
Files changed (30) hide show
  1. {tmnt-0.7.49/tmnt.egg-info → tmnt-0.7.50}/PKG-INFO +1 -1
  2. {tmnt-0.7.49 → tmnt-0.7.50}/setup.py +1 -1
  3. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt/modeling.py +4 -3
  4. {tmnt-0.7.49 → tmnt-0.7.50/tmnt.egg-info}/PKG-INFO +1 -1
  5. {tmnt-0.7.49 → tmnt-0.7.50}/LICENSE +0 -0
  6. {tmnt-0.7.49 → tmnt-0.7.50}/NOTICE +0 -0
  7. {tmnt-0.7.49 → tmnt-0.7.50}/README.md +0 -0
  8. {tmnt-0.7.49 → tmnt-0.7.50}/setup.cfg +0 -0
  9. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt/__init__.py +0 -0
  10. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt/configuration.py +0 -0
  11. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt/data_loading.py +0 -0
  12. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt/distribution.py +0 -0
  13. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt/estimator.py +0 -0
  14. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt/eval_npmi.py +0 -0
  15. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt/inference.py +0 -0
  16. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt/preprocess/__init__.py +0 -0
  17. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt/preprocess/tokenizer.py +0 -0
  18. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt/preprocess/vectorizer.py +0 -0
  19. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt/utils/__init__.py +0 -0
  20. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt/utils/csv2json.py +0 -0
  21. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt/utils/log_utils.py +0 -0
  22. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt/utils/mat_utils.py +0 -0
  23. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt/utils/ngram_helpers.py +0 -0
  24. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt/utils/pubmed_utils.py +0 -0
  25. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt/utils/random.py +0 -0
  26. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt/utils/recalibrate.py +0 -0
  27. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt.egg-info/SOURCES.txt +0 -0
  28. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt.egg-info/dependency_links.txt +0 -0
  29. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt.egg-info/requires.txt +0 -0
  30. {tmnt-0.7.49 → tmnt-0.7.50}/tmnt.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tmnt
3
- Version: 0.7.49
3
+ Version: 0.7.50
4
4
  Summary: Topic modeling neural toolkit
5
5
  Home-page: https://github.com/mitre/tmnt.git
6
6
  Author: The MITRE Corporation
@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
4
4
  from setuptools.command.install import install
5
5
  from pathlib import Path
6
6
 
7
- version = '0.7.49'
7
+ version = '0.7.50'
8
8
 
9
9
  try:
10
10
  if not os.getenv('RELEASE'):
@@ -788,7 +788,7 @@ class SelfEmbeddingCrossEntropyLoss(_Loss):
788
788
  - **loss**: loss tensor with shape (batch_size,).
789
789
  """
790
790
 
791
- def __init__(self, teacher_right=True, metric_loss_temp=0.1, batch_axis=0, **kwargs):
791
+ def __init__(self, teacher_right=True, metric_loss_temp=1.0, batch_axis=0, **kwargs):
792
792
  super(SelfEmbeddingCrossEntropyLoss, self).__init__(batch_axis, **kwargs)
793
793
  self.cross_entropy_loss = nn.CrossEntropyLoss()
794
794
  self.metric_loss_temp = metric_loss_temp
@@ -801,8 +801,9 @@ class SelfEmbeddingCrossEntropyLoss(_Loss):
801
801
  """
802
802
  x1_norm = torch.nn.functional.normalize(x1, p=2, dim=1)
803
803
  x2_norm = torch.nn.functional.normalize(x2, p=2, dim=1)
804
- cross_side_distances = torch.mm(x1_norm, x2_norm.transpose(0,1))
805
- single_side_distances = torch.mm(x2_norm, x2_norm.transpose(0,1)) if self.teacher_right else torch.mm(x1_norm, x1_norm.transpose(0,1))
804
+ cross_side_distances = torch.mm(x1_norm, x2_norm.transpose(0,1)) / self.metric_loss_temp
805
+ single_side_distances = torch.mm(x2_norm, x2_norm.transpose(0,1)) / self.metric_loss_temp if self.teacher_right \
806
+ else torch.mm(x1_norm, x1_norm.transpose(0,1)) / self.metric_loss_temp
806
807
  # multiply by the batch size to obtain the sum loss (kl_loss averages instead of sum)
807
808
  return self.cross_entropy_loss(cross_side_distances, single_side_distances.to(single_side_distances.device))
808
809
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tmnt
3
- Version: 0.7.49
3
+ Version: 0.7.50
4
4
  Summary: Topic modeling neural toolkit
5
5
  Home-page: https://github.com/mitre/tmnt.git
6
6
  Author: The MITRE Corporation
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes