deeplotx 0.4.12b3__tar.gz → 0.4.12b4__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 (33) hide show
  1. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/PKG-INFO +1 -1
  2. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/nn/base_neural_network.py +3 -2
  3. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx.egg-info/PKG-INFO +1 -1
  4. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/pyproject.toml +1 -1
  5. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/LICENSE +0 -0
  6. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/README.md +0 -0
  7. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/__init__.py +0 -0
  8. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/encoder/__init__.py +0 -0
  9. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/encoder/bert_encoder.py +0 -0
  10. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/encoder/long_text_encoder.py +0 -0
  11. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/encoder/longformer_encoder.py +0 -0
  12. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/nn/__init__.py +0 -0
  13. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/nn/auto_regression.py +0 -0
  14. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/nn/linear_regression.py +0 -0
  15. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/nn/logistic_regression.py +0 -0
  16. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/nn/recursive_sequential.py +0 -0
  17. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/nn/softmax_regression.py +0 -0
  18. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/similarity/__init__.py +0 -0
  19. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/similarity/distribution.py +0 -0
  20. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/similarity/set.py +0 -0
  21. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/similarity/vector.py +0 -0
  22. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/trainer/__init__.py +0 -0
  23. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/trainer/base_trainer.py +0 -0
  24. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/trainer/text_binary_classification_trainer.py +0 -0
  25. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/util/__init__.py +0 -0
  26. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/util/hash.py +0 -0
  27. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx/util/read_file.py +0 -0
  28. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx.egg-info/SOURCES.txt +0 -0
  29. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx.egg-info/dependency_links.txt +0 -0
  30. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx.egg-info/requires.txt +0 -0
  31. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/deeplotx.egg-info/top_level.txt +0 -0
  32. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/setup.cfg +0 -0
  33. {deeplotx-0.4.12b3 → deeplotx-0.4.12b4}/test/test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deeplotx
3
- Version: 0.4.12b3
3
+ Version: 0.4.12b4
4
4
  Summary: Easy-2-use long text NLP toolkit.
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -24,7 +24,7 @@ class BaseNeuralNetwork(nn.Module):
24
24
 
25
25
  def l1(self, _lambda: float = 1e-4) -> torch.Tensor:
26
26
  def _l1() -> torch.Tensor:
27
- l2_reg = torch.tensor(0.)
27
+ l2_reg = torch.tensor(0., device=self.device, dtype=self.dtype)
28
28
  for param in self.parameters():
29
29
  l2_reg += (torch.abs(param)).sum()
30
30
  return l2_reg
@@ -32,7 +32,7 @@ class BaseNeuralNetwork(nn.Module):
32
32
 
33
33
  def l2(self, _lambda: float = 1e-4) -> torch.Tensor:
34
34
  def _l2() -> torch.Tensor:
35
- l2_reg = torch.tensor(0.)
35
+ l2_reg = torch.tensor(0., device=self.device, dtype=self.dtype)
36
36
  for param in self.parameters():
37
37
  l2_reg += (torch.pow(param, exponent=2.)).sum()
38
38
  return l2_reg
@@ -45,6 +45,7 @@ class BaseNeuralNetwork(nn.Module):
45
45
  def forward(self, *args, **kwargs) -> torch.Tensor: ...
46
46
 
47
47
  def predict(self, x) -> torch.Tensor:
48
+ x = self.ensure_device_and_dtype(x, device=self.device, dtype=self.dtype)
48
49
  __train = self.training
49
50
  self.training = False
50
51
  with torch.no_grad():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deeplotx
3
- Version: 0.4.12b3
3
+ Version: 0.4.12b4
4
4
  Summary: Easy-2-use long text NLP toolkit.
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "deeplotx"
3
- version = "0.4.12.beta3"
3
+ version = "0.4.12.beta4"
4
4
  description = "Easy-2-use long text NLP toolkit."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
File without changes
File without changes
File without changes
File without changes