This file contains hidden or 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.optimizer import Optimizer, required | |
import torch | |
# almost copy paste from https://github.com/noahgolmant/pytorch-lars/blob/master/lars.py | |
class LARS(Optimizer): | |
r"""Implements LARS (Layer-wise Adaptive Rate Scaling). | |
Args: | |
params (iterable): iterable of parameters to optimize or dicts defining | |
parameter groups | |
lr (float): learning rate |
This file contains hidden or 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
""" | |
A K-NN implemented with pytorch data loading for evaluation of | |
self-supervised pretraining | |
Authors: Nikolas Adaloglou, Nima Rafiee | |
MIT Licence | |
Copyright © 2021 Nikolas Adaloglou, Nima Rafiee | |
Permission is hereby granted, free of charge, to any person |