deeplotx 0.8.0__py3-none-any.whl → 0.8.2__py3-none-any.whl
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.
- deeplotx/nn/attention.py +1 -1
- deeplotx/nn/rope.py +2 -1
- {deeplotx-0.8.0.dist-info → deeplotx-0.8.2.dist-info}/METADATA +1 -1
- {deeplotx-0.8.0.dist-info → deeplotx-0.8.2.dist-info}/RECORD +7 -7
- {deeplotx-0.8.0.dist-info → deeplotx-0.8.2.dist-info}/WHEEL +0 -0
- {deeplotx-0.8.0.dist-info → deeplotx-0.8.2.dist-info}/licenses/LICENSE +0 -0
- {deeplotx-0.8.0.dist-info → deeplotx-0.8.2.dist-info}/top_level.txt +0 -0
deeplotx/nn/attention.py
CHANGED
@@ -36,7 +36,7 @@ class Attention(BaseNeuralNetwork):
|
|
36
36
|
attn = torch.matmul(q, k.transpose(-2, -1))
|
37
37
|
attn = attn / (self._feature_dim ** 0.5)
|
38
38
|
attn = attn.masked_fill(mask == 0, -1e9) if mask is not None else attn
|
39
|
-
return torch.softmax(attn, dim=-1)
|
39
|
+
return torch.softmax(attn, dtype=self.dtype, dim=-1)
|
40
40
|
|
41
41
|
@override
|
42
42
|
def forward(self, x: torch.Tensor, y: torch.Tensor | None = None, mask: torch.Tensor | None = None) -> torch.Tensor:
|
deeplotx/nn/rope.py
CHANGED
@@ -15,7 +15,8 @@ class RoPE(BaseNeuralNetwork):
|
|
15
15
|
assert feature_dim % 2 == 0, f'feature_dim ({feature_dim}) is not divisible by 2.'
|
16
16
|
self._theta = theta
|
17
17
|
self._num_groups = feature_dim // 2
|
18
|
-
self._inv_freq = 1.0 / (theta ** (torch.arange(start=0, end=self._num_groups, step=1
|
18
|
+
self._inv_freq = 1.0 / (theta ** (torch.arange(start=0, end=self._num_groups, step=1,
|
19
|
+
device=self.device, dtype=self.dtype).float() / self._num_groups))
|
19
20
|
self.register_buffer('inv_freq', self._inv_freq)
|
20
21
|
|
21
22
|
@property
|
@@ -4,7 +4,7 @@ deeplotx/encoder/encoder.py,sha256=oSBdA-MiwMKNfTFJWR-RdvNS0G0qfX-Qchwy4LuwB00,3
|
|
4
4
|
deeplotx/encoder/long_text_encoder.py,sha256=PFR6jjGyg1N58TQlKsPaNQEd-EDl13Hyhu7A1KtGBbA,3743
|
5
5
|
deeplotx/encoder/longformer_encoder.py,sha256=A8FXqd4mdHxSn_o_R689XtpT73ISDT788EgMQRGLC2g,1822
|
6
6
|
deeplotx/nn/__init__.py,sha256=01I_yqx9GTa4wy3uNyAqhtxp66tDqxgMLC4Ky5Vnkrg,651
|
7
|
-
deeplotx/nn/attention.py,sha256=
|
7
|
+
deeplotx/nn/attention.py,sha256=R-i-Rd7gnsh6hwXDeYfqLQOJvfSZIGfQbFzRlC91XLo,2879
|
8
8
|
deeplotx/nn/auto_regression.py,sha256=uISx29t_zkDGS8s2wvGB6wOGYZitQ4hQ7wyoQl4lcqY,857
|
9
9
|
deeplotx/nn/base_neural_network.py,sha256=FjQEDFH810fJS7JV3aLgJZnaMqC6DH--wlBvuj-ghTc,5900
|
10
10
|
deeplotx/nn/feed_forward.py,sha256=4ozj7EDalO9pb6JUhZtsJqE0r8bIHFApHRt2zTrl4ho,2931
|
@@ -15,7 +15,7 @@ deeplotx/nn/long_context_recursive_sequential.py,sha256=i7kUml9RV_mkLRJ114UHsj9G
|
|
15
15
|
deeplotx/nn/multi_head_attention.py,sha256=3z73uGbvy3jszRy1B9nxGOJjlttHpcpRF8Qd09OEams,2267
|
16
16
|
deeplotx/nn/recursive_sequential.py,sha256=8Z8vT70xTygusL-3w3QlB_B_k0xQSUU2ZTgC1LhEmzQ,2805
|
17
17
|
deeplotx/nn/roformer_encoder.py,sha256=UJjKniNdMd0rfoYQcsX6bPo6Ceq_Z6EhwHe2kgqWC_k,2426
|
18
|
-
deeplotx/nn/rope.py,sha256=
|
18
|
+
deeplotx/nn/rope.py,sha256=RTOjnllubktdy2rzFWxBfkuLuGjhEMyDd06uojdqPhM,1848
|
19
19
|
deeplotx/nn/softmax_regression.py,sha256=PN_1Zr_B_z5zYC_s_8k6c5fllOtxfJEvVvCmC9GRmx0,958
|
20
20
|
deeplotx/similarity/__init__.py,sha256=s3u-KSgxjnMcWpIItKgXNltFMPQ7YY3CqsqHI-5F1c8,724
|
21
21
|
deeplotx/similarity/distribution.py,sha256=wQGouuuW531pZeBRKBujXsdsoz4fDnPw7_GW81jwepc,1066
|
@@ -27,8 +27,8 @@ deeplotx/trainer/text_binary_classification_trainer.py,sha256=QMLR4cC8NCUP-v7SOY
|
|
27
27
|
deeplotx/util/__init__.py,sha256=5CH4MTeSgsmCe3LPMfvKoSBpwh6jDSBuHVElJvzQzgs,90
|
28
28
|
deeplotx/util/hash.py,sha256=qbNU3RLBWGQYFVte9WZBAkZ1BkdjCXiKLDaKPN54KFk,662
|
29
29
|
deeplotx/util/read_file.py,sha256=ptzouvEQeeW8KU5BrWNJlXw-vFXVrpS9SkAUxsu6A8A,612
|
30
|
-
deeplotx-0.8.
|
31
|
-
deeplotx-0.8.
|
32
|
-
deeplotx-0.8.
|
33
|
-
deeplotx-0.8.
|
34
|
-
deeplotx-0.8.
|
30
|
+
deeplotx-0.8.2.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
|
31
|
+
deeplotx-0.8.2.dist-info/METADATA,sha256=nYbTzZTrgKWDcUMv_QFQDxcnuTgxt1Icg1SWzUbLXks,12251
|
32
|
+
deeplotx-0.8.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
33
|
+
deeplotx-0.8.2.dist-info/top_level.txt,sha256=hKg4pVDXZ-WWxkRfJFczRIll1Sv7VyfKCmzHLXbuh1U,9
|
34
|
+
deeplotx-0.8.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|