code: def test_triangular2_cyclical_learning_rate(serialize):
      initial_lr = 0.1
      maximal_lr = 1
      step_size = 30
      triangular2_lr = (
          cyclical_learning_rate.Triangular2CyclicalLearningRate(
              initial_learning_rate=initial_lr,
              maximal_learning_rate=maximal_lr,
              step_size=step_size,
          )
      )
      triangular2_lr = _maybe_serialized(triangular2_lr, serialize)
  
      middle_lr = (maximal_lr + initial_lr) / 2
      expected = np.concatenate(
          [
              np.linspace(initial_lr, maximal_lr, num=step_size + 1),
              np.linspace(maximal_lr, initial_lr, num=step_size + 1)[
                  1:
              ],
              np.linspace(initial_lr, middle_lr, num=step_size + 1)[1:],
              np.linspace(middle_lr, initial_lr, num=step_size + 1)[1:],
          ]
      )
  
      for step, expected_value in enumerate(expected):
          np.testing.assert_allclose(
              triangular2_lr(step).numpy(), expected_value, 1e-6
          )
  
file_path: addons/tensorflow_addons/optimizers/tests/cyclical_learning_rate_test.py
imports: import pytest
  import numpy
  from tensorflow_addons.optimizers import cyclical_learning_rate
label_desc: Use image node_id 3 for calling a global function with example usage: test_triangular2_cyclical_learning_rate(serialize) without return types