docstr: ...Test of ProxL2
          
docstr_tok: ["...","Test","of","ProxL2"]
code: def test_ProxL2(self):
      """...Test of ProxL2"""
      coeffs = self.coeffs.copy().astype(self.dtype)
      out = coeffs.copy()
      strength = 3e-2
      step = 1.7
  
      prox = ProxL2(strength).astype(self.dtype)
      thresh = step * strength * coeffs.shape[0] ** 0.5
      norm = np.linalg.norm(coeffs)
      out *= (1.0 - thresh / norm) * ((1.0 - thresh / norm) > 0)
      self.assertAlmostEqual(
          prox.value(coeffs),
          strength * coeffs.shape[0] ** 0.5 * norm,
          delta=self.delta,
      )
      assert_almost_equal(
          prox.call(coeffs, step=step), out, decimal=self.decimal_places
      )
  
      start = 3
      end = 8
      range = (start, end)
      prox = ProxL2(strength, range).astype(self.dtype)
      thresh = step * strength * (end - start) ** 0.5
      norm = np.linalg.norm(coeffs[3:8])
      out = coeffs.copy()
      out[3:8] *= (1.0 - thresh / norm) * ((1.0 - thresh / norm) > 0)
  
      self.assertAlmostEqual(
          prox.value(coeffs),
          strength * (end - start) ** 0.5 * norm,
          delta=self.delta,
      )
      assert_almost_equal(
          prox.call(coeffs, step=step), out, decimal=self.decimal_places
      )
  
      prox = ProxL2(strength, range, positive=True).astype(self.dtype)
      thresh = step * strength * (end - start) ** 0.5
      norm = np.linalg.norm(coeffs[3:8])
      out = coeffs.copy()
      out[3:8] *= (1.0 - thresh / norm) * ((1.0 - thresh / norm) > 0)
      idx = out[3:8] < 0
      out[3:8][idx] = 0
  
      self.assertAlmostEqual(
          prox.value(coeffs),
          strength * (end - start) ** 0.5 * norm,
          delta=self.delta,
      )
      assert_almost_equal(
          prox.call(coeffs, step=step), out, decimal=self.decimal_places
      )
  
file_path: tick/tick/prox/tests/prox_l2_test.py
imports: import unittest
  from numpy.testing import assert_almost_equal
  import numpy
  from tick.prox import ProxL2
  from tick.prox.tests.prox import TestProx
label_desc: Use image node_id 1 for calling the ProxL2Test obj's underlying member method code with example usage: obj.test_ProxL2() without return types