code: def test_triangular_cyclical_learning_rate(serialize):
      initial_learning_rate = 0.1
      max_learning_rate = 1
      step_size = 40
      triangular_cyclical_lr = (
          cyclical_learning_rate.TriangularCyclicalLearningRate(
              initial_learning_rate=initial_learning_rate,
              maximal_learning_rate=max_learning_rate,
              step_size=step_size,
          )
      )
      triangular_cyclical_lr = _maybe_serialized(
          triangular_cyclical_lr, serialize
      )
  
      expected = np.concatenate(
          [
              np.linspace(
                  initial_learning_rate,
                  max_learning_rate,
                  num=step_size + 1,
              ),
              np.linspace(
                  max_learning_rate,
                  initial_learning_rate,
                  num=step_size + 1,
              )[1:],
          ]
      )
  
      for step, expected_value in enumerate(expected):
          np.testing.assert_allclose(
              triangular_cyclical_lr(step), 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 2 for calling a global function with example usage: test_triangular_cyclical_learning_rate(serialize) without return types