ml4gw 0.7.8__tar.gz → 0.7.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.

Potentially problematic release.


This version of ml4gw might be problematic. Click here for more details.

Files changed (66) hide show
  1. {ml4gw-0.7.8 → ml4gw-0.7.9}/PKG-INFO +1 -1
  2. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/distributions.py +20 -8
  3. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw.egg-info/PKG-INFO +1 -1
  4. {ml4gw-0.7.8 → ml4gw-0.7.9}/LICENSE +0 -0
  5. {ml4gw-0.7.8 → ml4gw-0.7.9}/README.md +0 -0
  6. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/__init__.py +0 -0
  7. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/augmentations.py +0 -0
  8. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/constants.py +0 -0
  9. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/dataloading/__init__.py +0 -0
  10. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/dataloading/chunked_dataset.py +0 -0
  11. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/dataloading/hdf5_dataset.py +0 -0
  12. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/dataloading/in_memory_dataset.py +0 -0
  13. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/gw.py +0 -0
  14. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/nn/__init__.py +0 -0
  15. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/nn/autoencoder/__init__.py +0 -0
  16. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/nn/autoencoder/base.py +0 -0
  17. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/nn/autoencoder/convolutional.py +0 -0
  18. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/nn/autoencoder/skip_connection.py +0 -0
  19. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/nn/autoencoder/utils.py +0 -0
  20. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/nn/norm.py +0 -0
  21. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/nn/resnet/__init__.py +0 -0
  22. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/nn/resnet/resnet_1d.py +0 -0
  23. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/nn/resnet/resnet_2d.py +0 -0
  24. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/nn/streaming/__init__.py +0 -0
  25. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/nn/streaming/online_average.py +0 -0
  26. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/nn/streaming/snapshotter.py +0 -0
  27. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/spectral.py +0 -0
  28. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/transforms/__init__.py +0 -0
  29. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/transforms/decimator.py +0 -0
  30. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/transforms/iirfilter.py +0 -0
  31. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/transforms/pearson.py +0 -0
  32. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/transforms/qtransform.py +0 -0
  33. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/transforms/scaler.py +0 -0
  34. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/transforms/snr_rescaler.py +0 -0
  35. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/transforms/spectral.py +0 -0
  36. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/transforms/spectrogram.py +0 -0
  37. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/transforms/spline_interpolation.py +0 -0
  38. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/transforms/transform.py +0 -0
  39. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/transforms/waveforms.py +0 -0
  40. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/transforms/whitening.py +0 -0
  41. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/types.py +0 -0
  42. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/utils/interferometer.py +0 -0
  43. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/utils/slicing.py +0 -0
  44. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/waveforms/__init__.py +0 -0
  45. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/waveforms/adhoc/__init__.py +0 -0
  46. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/waveforms/adhoc/ringdown.py +0 -0
  47. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/waveforms/adhoc/sine_gaussian.py +0 -0
  48. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/waveforms/cbc/__init__.py +0 -0
  49. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/waveforms/cbc/coefficients.py +0 -0
  50. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/waveforms/cbc/phenom_d.py +0 -0
  51. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/waveforms/cbc/phenom_d_data.py +0 -0
  52. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/waveforms/cbc/phenom_p.py +0 -0
  53. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/waveforms/cbc/taylorf2.py +0 -0
  54. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/waveforms/cbc/utils.py +0 -0
  55. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/waveforms/conversion.py +0 -0
  56. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw/waveforms/generator.py +0 -0
  57. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw.egg-info/SOURCES.txt +0 -0
  58. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw.egg-info/dependency_links.txt +0 -0
  59. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw.egg-info/requires.txt +0 -0
  60. {ml4gw-0.7.8 → ml4gw-0.7.9}/ml4gw.egg-info/top_level.txt +0 -0
  61. {ml4gw-0.7.8 → ml4gw-0.7.9}/pyproject.toml +0 -0
  62. {ml4gw-0.7.8 → ml4gw-0.7.9}/setup.cfg +0 -0
  63. {ml4gw-0.7.8 → ml4gw-0.7.9}/tests/test_augmentations.py +0 -0
  64. {ml4gw-0.7.8 → ml4gw-0.7.9}/tests/test_distributions.py +0 -0
  65. {ml4gw-0.7.8 → ml4gw-0.7.9}/tests/test_gw.py +0 -0
  66. {ml4gw-0.7.8 → ml4gw-0.7.9}/tests/test_spectral.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ml4gw
3
- Version: 0.7.8
3
+ Version: 0.7.9
4
4
  Summary: Tools for training torch models on gravitational wave data
5
5
  Author-email: Ethan Marx <emarx@mit.edu>, Will Benoit <benoi090@umn.edu>, Deep Chatterjee <deep1018@mit.edu>, Alec Gunny <alec.gunny@ligo.org>, Ravi Kumar <ravi.kumar@ligo.org>
6
6
  Maintainer-email: Ethan Marx <emarx@mit.edu>, Will Benoit <benoi090@umn.edu>, Deep Chatterjee <deep1018@mit.edu>
@@ -225,8 +225,10 @@ class UniformComovingVolume(dist.Distribution):
225
225
  f"or 'luminosity_distance'; got {distance_type}"
226
226
  )
227
227
 
228
- self.minimum = minimum
229
- self.maximum = maximum
228
+ self.minimum = torch.as_tensor(minimum)
229
+ self.maximum = torch.as_tensor(maximum)
230
+ if self.minimum.device != self.maximum.device:
231
+ raise RuntimeError("Min and max values are not on same device")
230
232
  self.distance_type = distance_type
231
233
  self.grid_size = grid_size
232
234
  self.z_grid_max = z_grid_max
@@ -265,7 +267,9 @@ class UniformComovingVolume(dist.Distribution):
265
267
  distances, using the specified distance type.
266
268
  """
267
269
  self._generate_distance_grids()
268
- bounds = torch.tensor([self.minimum, self.maximum])
270
+ bounds = torch.tensor(
271
+ [self.minimum, self.maximum], device=self.minimum.device
272
+ )
269
273
  z_min, z_max = self._linear_interp_1d(
270
274
  self.distance_grid, self.z_grid, bounds
271
275
  )
@@ -276,7 +280,9 @@ class UniformComovingVolume(dist.Distribution):
276
280
  """
277
281
  Generate distance grids based on the specified redshift range.
278
282
  """
279
- self.z_grid = torch.linspace(0, self.z_grid_max, self.grid_size)
283
+ self.z_grid = torch.linspace(
284
+ 0, self.z_grid_max, self.grid_size, device=self.minimum.device
285
+ )
280
286
  self.dz = self.z_grid[1] - self.z_grid[0]
281
287
  # C is specfied in m/s, h0 in km/s/Mpc, so divide by 1000 to convert
282
288
  comoving_dist_grid = (
@@ -285,7 +291,9 @@ class UniformComovingVolume(dist.Distribution):
285
291
  )
286
292
  / 1000
287
293
  )
288
- zero_prefix = torch.zeros(1, dtype=comoving_dist_grid.dtype)
294
+ zero_prefix = torch.zeros(
295
+ 1, dtype=comoving_dist_grid.dtype, device=self.minimum.device
296
+ )
289
297
  self.comoving_dist_grid = torch.cat([zero_prefix, comoving_dist_grid])
290
298
  self.luminosity_dist_grid = self.comoving_dist_grid * (1 + self.z_grid)
291
299
 
@@ -315,7 +323,9 @@ class UniformComovingVolume(dist.Distribution):
315
323
  p_of_distance, self.distance_grid
316
324
  )
317
325
  cdf = torch.cumulative_trapezoid(self.pdf, self.distance_grid)
318
- zero_prefix = torch.zeros(1, dtype=cdf.dtype)
326
+ zero_prefix = torch.zeros(
327
+ 1, dtype=cdf.dtype, device=self.minimum.device
328
+ )
319
329
  self.cdf = torch.cat([zero_prefix, cdf])
320
330
  self.log_pdf = torch.log(self.pdf)
321
331
 
@@ -333,7 +343,7 @@ class UniformComovingVolume(dist.Distribution):
333
343
 
334
344
  def rsample(self, sample_shape: torch.Size = None) -> Tensor:
335
345
  sample_shape = sample_shape or torch.Size()
336
- u = torch.rand(sample_shape)
346
+ u = torch.rand(sample_shape, device=self.minimum.device)
337
347
  return self._linear_interp_1d(self.cdf, self.distance_grid, u)
338
348
 
339
349
  def log_prob(self, value: Tensor) -> Tensor:
@@ -341,7 +351,9 @@ class UniformComovingVolume(dist.Distribution):
341
351
  self.distance_grid, self.log_pdf, value
342
352
  )
343
353
  inside_range = (value >= self.minimum) & (value <= self.maximum)
344
- log_prob[~inside_range] = float("-inf")
354
+ log_prob[~inside_range] = torch.as_tensor(
355
+ float("-inf"), device=self.minimum.device
356
+ )
345
357
  return log_prob
346
358
 
347
359
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ml4gw
3
- Version: 0.7.8
3
+ Version: 0.7.9
4
4
  Summary: Tools for training torch models on gravitational wave data
5
5
  Author-email: Ethan Marx <emarx@mit.edu>, Will Benoit <benoi090@umn.edu>, Deep Chatterjee <deep1018@mit.edu>, Alec Gunny <alec.gunny@ligo.org>, Ravi Kumar <ravi.kumar@ligo.org>
6
6
  Maintainer-email: Ethan Marx <emarx@mit.edu>, Will Benoit <benoi090@umn.edu>, Deep Chatterjee <deep1018@mit.edu>
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