PhaseNet 0.2.6.dev0__py3-none-any.whl → 0.2.6.dev1__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.
phasenet/models/unet.py CHANGED
@@ -194,7 +194,9 @@ class ChanRMSNorm(nn.Module):
194
194
  self.gamma = nn.Parameter(torch.ones(dim, 1, 1))
195
195
 
196
196
  def forward(self, x):
197
- return F.normalize(x, dim = 1) * self.scale * self.gamma
197
+ # = F.normalize(x, dim = 1) * scale * gamma; F.normalize's norm over the strided channel axis is ~30x slower on CPU
198
+ inv_norm = torch.rsqrt(x.float().pow(2).sum(dim = 1, keepdim = True).clamp_min(1e-24)) # max(||x||, 1e-12) as F.normalize
199
+ return x * inv_norm.to(x.dtype) * (self.scale * self.gamma)
198
200
 
199
201
  class LayerNorm(nn.Module):
200
202
  def __init__(self, feats, stable = False, dim = -1):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: phasenet
3
- Version: 0.2.6.dev0
3
+ Version: 0.2.6.dev1
4
4
  Summary: A PyTorch implementation of PhaseNet for seismic and DAS phase picking
5
5
  Author: Weiqiang Zhu
6
6
  License-Expression: MIT
@@ -15,7 +15,7 @@ phasenet/models/phasenet_das_plus.py,sha256=kbBR5dCUIeHsF6FUBaBtb8YiJH_BIqJ1-on4
15
15
  phasenet/models/phasenet_plus.py,sha256=XzXo8NIiszWF5W4XosaxDrtvbd9uJZ-IV4Tdv7u1oYE,845
16
16
  phasenet/models/phasenet_tf.py,sha256=Mp6BrRFAftiojb6KVMayIfGFmiYGk1RLS_ijb4kRqh0,520
17
17
  phasenet/models/phasenet_tf_plus.py,sha256=6qLta1t6VX5Nbzz7WUArezCpaYzOkedncr_fHEqtMSU,862
18
- phasenet/models/unet.py,sha256=i-WFjDK7Pq5EpRIUpiS9AtfW6-6hnBguIiMqRXUbRmE,50552
18
+ phasenet/models/unet.py,sha256=74t0oSnXhGDKU_xABbvhw7EKIBEFUZ-j9VKniYLuIHA,50810
19
19
  phasenet/models/unet2018.py,sha256=CNC5WZgNiGNYOreSyNIIoscbpnfUlMM1-VqIzqNCt-E,9698
20
20
  phasenet/models/prompt/__init__.py,sha256=0eHb9jPFpSMCqnQ_0I2NDbL2b0GQbAc-uJXELEwVobk,388
21
21
  phasenet/models/prompt/common.py,sha256=_TvpynFC3sJdvGEdUulnM_a6LH7BSH49wy80u7_Q1S4,1478
@@ -27,8 +27,8 @@ phasenet/utils/detect_peaks_cpu.py,sha256=rfmCt7kmYoaD9628Gqg35AfHNJUSyaUbR2jYsW
27
27
  phasenet/utils/inference.py,sha256=IoODCegrkkesCd0D7NpZd0sGVxcGw97T9GNu7p4h0N0,18991
28
28
  phasenet/utils/postprocess.py,sha256=vMaTirZz74EwErQ-0XuuHC-khStuZ7HpOCcqlbzbh20,27822
29
29
  phasenet/utils/visualization.py,sha256=xYLwf6bvi6T7Y2JDM4h_K7FNRMTGWHA-MfzvA5RPzUE,64509
30
- phasenet-0.2.6.dev0.dist-info/METADATA,sha256=IUGqwNjx2n4CYPZbpwE_bOuArmLVtlWAKu6oebeqwaE,23401
31
- phasenet-0.2.6.dev0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
32
- phasenet-0.2.6.dev0.dist-info/entry_points.txt,sha256=KtFxljWZsfYJZgueyYHjmAzlaTPg7KtSz7Cv-DN9k1Y,76
33
- phasenet-0.2.6.dev0.dist-info/top_level.txt,sha256=9-uWnc7M26pB07J5d7JFarMr7iwbOBOpAhxqpz8MtYw,29
34
- phasenet-0.2.6.dev0.dist-info/RECORD,,
30
+ phasenet-0.2.6.dev1.dist-info/METADATA,sha256=CfSdtYhzLuFIzoUHvEvNhLAJCFLditalJzkPw3TvHuY,23401
31
+ phasenet-0.2.6.dev1.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
32
+ phasenet-0.2.6.dev1.dist-info/entry_points.txt,sha256=KtFxljWZsfYJZgueyYHjmAzlaTPg7KtSz7Cv-DN9k1Y,76
33
+ phasenet-0.2.6.dev1.dist-info/top_level.txt,sha256=9-uWnc7M26pB07J5d7JFarMr7iwbOBOpAhxqpz8MtYw,29
34
+ phasenet-0.2.6.dev1.dist-info/RECORD,,