code: def test_adam_optimize(art_warning):
      try:
  
          def func(x):
              return (x - 2) ** 2
  
          def jacobian(x):
              return 2 * (x - 2)
  
          optimizer = Adam(alpha=0.5)
  
          x_0 = 10
          max_iter = 1000
          loss_converged = 0.01
  
          x_opt = optimizer.optimize(
              func, jacobian, x_0, max_iter, loss_converged
          )
  
          assert pytest.approx(1.94, abs=0.02) == x_opt
  
      except ARTTestException as e:
          art_warning(e)
  
imports: import logging
  import pytest
  from art.optimizers import Adam
  from tests.utils import ARTTestException
label_desc: Use image node_id 1 for calling a global function with example usage: test_adam_optimize(art_warning) and returns: unknown, unknown