This gist is an accumulation of high-quality implementations and packages useful for research in reinforcement learning.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from torch.optim.lr_scheduler import _LRScheduler | |
import numpy as np | |
class InterpolatingScheduler(_LRScheduler): | |
def __init__(self, optimizer, steps, lrs, scale='log', last_epoch=-1): | |
"""A scheduler that interpolates given values | |
Args: | |
- optimizer: pytorch optimizer | |
- steps: list or array with the x coordinates of the interpolated values |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2016-2022 Paul Durivage | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |