Repository: kymatio/kymatio

Issue:
Make NumPy the default frontend
Since we promised earlier:

```
  /home/jenkins/workspace/kymatio_dev/kymatio/frontend/entry.py:20: DeprecationWarning: Torch frontend is currently the default, but NumPy will become the default in the next version.
    warnings.warn("Torch frontend is currently the default, but NumPy will become the default in the next"
```


Discussion:
This is a deep learning package and we should focus on that first and foremost. This is a promise we should recind. @eickenberg thoughts?
@MuawizChaudhary since you seem to feel strongly about it (#806), know that i can have it either way. I've expressed my views here: https://github.com/kymatio/kymatio/issues/806#issuecomment-1113966458
and i think that @janden's compromise of "How about not having a default at all?" is optimal, even though i hadn't considered this option in my comment.

I don't have a clear enough sense of what problem you're trying to solve here. I don't think that telling our Torch users to import `from kymatio.torch` rather than `from kymatio` will alienate them from us. But maybe i'm missing the point here, so i'll abstain. (i.e. i won't block any decision that comes out from the three of you)
For the reasons mentioned in #806 (dependencies, ease of installation), I don't think it's a good idea to have a hard torch dependency. That being said, I agree that it's a little strange to have the default be NumPy. Hence my suggestion that we remove `kymatio.Scattering*d` completely. We could change the deprecation message to say this and postpone the removal to the next release.

Resolving patch:
diff --git a/kymatio/frontend/entry.py b/kymatio/frontend/entry.py
--- a/kymatio/frontend/entry.py
+++ b/kymatio/frontend/entry.py
@@ -17,9 +17,7 @@ def __init__(self, *args, **kwargs):
                              'sklearn': 'Transformer'}
 
         if 'frontend' not in kwargs:
-            warnings.warn("Torch frontend is currently the default, but NumPy will become the default in the next"
-                          " version.", DeprecationWarning)
-            frontend = 'torch'
+            frontend = 'numpy'
         else:
             frontend = kwargs['frontend'].lower()
             kwargs.pop('frontend')


Test patch:
diff --git a/tests/scattering1d/test_utils_scattering1d.py b/tests/scattering1d/test_utils_scattering1d.py
--- a/tests/scattering1d/test_utils_scattering1d.py
+++ b/tests/scattering1d/test_utils_scattering1d.py
@@ -1,7 +1,7 @@
 import numpy as np
 import pytest
 from kymatio import Scattering1D
-from kymatio.scattering1d.frontend.torch_frontend import ScatteringTorch1D
+from kymatio.scattering1d.frontend.numpy_frontend import ScatteringNumPy1D
 from kymatio.scattering1d.utils import compute_border_indices, compute_padding
 
 
@@ -56,7 +56,7 @@ def test_border_indices(random_state=42):
 # Check that the default frontend is numpy and that errors are correctly launched.
 def test_scattering1d_frontend():
     scattering = Scattering1D(2, shape=(10, ))
-    assert isinstance(scattering, ScatteringTorch1D), 'could not be correctly imported'
+    assert isinstance(scattering, ScatteringNumPy1D), 'could not be correctly imported'
 
     with pytest.raises(RuntimeError) as ve:
         scattering = Scattering1D(2, shape=(10,), frontend='doesnotexist')
diff --git a/tests/scattering2d/test_frontend_scattering2d.py b/tests/scattering2d/test_frontend_scattering2d.py
--- a/tests/scattering2d/test_frontend_scattering2d.py
+++ b/tests/scattering2d/test_frontend_scattering2d.py
@@ -1,18 +1,18 @@
 import pytest
 
 from kymatio import Scattering2D
-from kymatio.scattering2d.frontend.torch_frontend import ScatteringTorch2D
+from kymatio.scattering2d.frontend.numpy_frontend import ScatteringNumPy2D
 
-# Check that the default frontend is Torch and that errors are correctly launched.
+# Check that the default frontend is Numpy and that errors are correctly launched.
 def test_scattering2d_frontend():
     scattering = Scattering2D(2, shape=(10, 10))
-    assert isinstance(scattering, ScatteringTorch2D), 'Torch frontend is not selected by default'
+    assert isinstance(scattering, ScatteringNumPy2D), 'NumPy frontend is not selected by default'
 
     with pytest.raises(RuntimeError) as ve:
         scattering = Scattering2D(2, shape=(10, 10), frontend='doesnotexist')
     assert "is not valid" in ve.value.args[0]
 
-# Check the default backend is Torch and that errors are correctly launched.
+# Check the default backend is Numpy and that errors are correctly launched.
 def test_scattering2d_backend():
     with pytest.raises(ImportError) as ve:
         scattering = Scattering2D(2, shape=(10, 10), backend='doesnotexist')
diff --git a/tests/scattering3d/test_torch_scattering3d.py b/tests/scattering3d/test_torch_scattering3d.py
--- a/tests/scattering3d/test_torch_scattering3d.py
+++ b/tests/scattering3d/test_torch_scattering3d.py
@@ -4,7 +4,7 @@
 import io
 import numpy as np
 import pytest
-from kymatio import HarmonicScattering3D
+from kymatio.torch import HarmonicScattering3D
 from kymatio.scattering3d.utils import generate_weighted_sum_of_gaussians
 
 backends = []
@@ -171,7 +171,7 @@ def test_against_standard_computations(device, backend):
 
     scattering = HarmonicScattering3D(J=J, shape=(M, N, O), L=L,
             sigma_0=sigma, method='integral',
-            integral_powers=integral_powers, max_order=2, backend=backend, frontend='torch')
+            integral_powers=integral_powers, max_order=2, backend=backend)
 
     scattering.to(device)
     x = x.to(device)
@@ -218,8 +218,8 @@ def test_solid_harmonic_scattering(device, backend):
     x = torch.from_numpy(generate_weighted_sum_of_gaussians(grid, centers,
         weights, sigma_gaussian)).to(device).float()
     scattering = HarmonicScattering3D(J=J, shape=(M, N, O), L=L,
-            sigma_0=sigma_0_wavelet,max_order=1, method='integral',
-            integral_powers=[1], frontend='torch',backend=backend).to(device)
+            sigma_0=sigma_0_wavelet, max_order=1, method='integral',
+            integral_powers=[1], backend=backend).to(device)
 
     scattering.max_order = 1
     scattering.method = 'integral'
@@ -248,7 +248,7 @@ def test_larger_scales(device, backend):
     x = torch.randn((1,) + shape).to(device)
 
     for J in range(3, 4+1):
-        scattering = HarmonicScattering3D(J=J, shape=shape, L=L, sigma_0=sigma_0, frontend='torch', backend=backend).to(device)
+        scattering = HarmonicScattering3D(J=J, shape=shape, L=L, sigma_0=sigma_0, backend=backend).to(device)
         scattering.method = 'integral'
         Sx = scattering(x)
 
@@ -262,7 +262,7 @@ def test_scattering_batch_shape_agnostic(device, backend):
     J = 2
     shape = (16, 16, 16)
 
-    S = HarmonicScattering3D(J=J, shape=shape)
+    S = HarmonicScattering3D(J=J, shape=shape, backend=backend)
 
     for k in range(3):
         with pytest.raises(RuntimeError) as ve: