# Path: sockeye/lr_scheduler.py
# class LearningRateScheduler:
# class AdaptiveLearningRateScheduler(LearningRateScheduler):
# class LearningRateSchedulerInvSqrtDecay(LearningRateScheduler):
# class LearningRateSchedulerLinearDecay(LearningRateScheduler):
# class LearningRateSchedulerPlateauReduce(AdaptiveLearningRateScheduler):
#     def __init__(self, base_lr: float = 1.0, warmup: int = 0, t_scale: float = 1.0) -> None:
#     def __call__(self, t):
#     def _warmup(self, scaled_t):
#     def new_evaluation_result(self, has_improved: bool) -> bool:
#     def __call__(self, t: int):
#     def __init__(self, base_lr: float, total_steps: int, warmup: int = 0, t_scale: float = 1.0) -> None:
#     def __call__(self, t: int):
#     def __init__(self, base_lr: float, reduce_factor: float, reduce_num_not_improved: int, warmup: int = 0) -> None:
#     def new_evaluation_result(self, has_improved: bool) -> bool:
#     def __call__(self, t):
#     def __repr__(self):
# def get_lr_scheduler(scheduler_type: str,
#                      base_learning_rate: float,
#                      learning_rate_t_scale: float,
#                      learning_rate_reduce_factor: float,
#                      learning_rate_reduce_num_not_improved: int,
#                      learning_rate_warmup: int = 0,
#                      max_updates: Optional[int] = None) -> Optional[LearningRateScheduler]:


import pytest
import numpy as np
from sockeye import lr_scheduler
# Copyright 2017--2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not
# use this file except in compliance with the License. A copy of the License
# is located at
#
#     http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is distributed on
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.





@pytest.mark.parametrize('learning_rate_warmup,learning_rate_t_scale',
                         [(1, 1), (3, 2), (10, .5), (20, 1)])
def test_inv_sqrt_decay_scheduler(learning_rate_warmup, learning_rate_t_scale):

# Path: sockeye/lr_scheduler.py
# class LearningRateScheduler:
# class AdaptiveLearningRateScheduler(LearningRateScheduler):
# class LearningRateSchedulerInvSqrtDecay(LearningRateScheduler):
# class LearningRateSchedulerLinearDecay(LearningRateScheduler):
# class LearningRateSchedulerPlateauReduce(AdaptiveLearningRateScheduler):
#     def __init__(self, base_lr: float = 1.0, warmup: int = 0, t_scale: float = 1.0) -> None:
#     def __call__(self, t):
#     def _warmup(self, scaled_t):
#     def new_evaluation_result(self, has_improved: bool) -> bool:
#     def __call__(self, t: int):
#     def __init__(self, base_lr: float, total_steps: int, warmup: int = 0, t_scale: float = 1.0) -> None:
#     def __call__(self, t: int):
#     def __init__(self, base_lr: float, reduce_factor: float, reduce_num_not_improved: int, warmup: int = 0) -> None:
#     def new_evaluation_result(self, has_improved: bool) -> bool:
#     def __call__(self, t):
#     def __repr__(self):
# def get_lr_scheduler(scheduler_type: str,
#                      base_learning_rate: float,
#                      learning_rate_t_scale: float,
#                      learning_rate_reduce_factor: float,
#                      learning_rate_reduce_num_not_improved: int,
#                      learning_rate_warmup: int = 0,
#                      max_updates: Optional[int] = None) -> Optional[LearningRateScheduler]:


# Path: test/unit/test_lr_scheduler.py
import pytest
import numpy as np
from sockeye import lr_scheduler

# Copyright 2017--2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not
# use this file except in compliance with the License. A copy of the License
# is located at
#
#     http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is distributed on
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.





@pytest.mark.parametrize('learning_rate_warmup,learning_rate_t_scale',
                         [(1, 1), (3, 2), (10, .5), (20, 1)])
def test_inv_sqrt_decay_scheduler(learning_rate_warmup, learning_rate_t_scale):

    scheduler = lr_scheduler.get_lr_scheduler('inv-sqrt-decay',