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
# base on the paper "OPTIMIZATION AS A MODEL FOR FEW-SHOT LEARNING": https://openreview.net/pdf?id=rJY0-Kcll | |
class EmptySimpleMetaLstm(Optimizer): | |
def __init__(self, params, trainable_opt_model, trainable_opt_state, *args, **kwargs): | |
defaults = { | |
'trainable_opt_model':trainable_opt_model, | |
'trainable_opt_state':trainable_opt_state, | |
'args':args, | |
'kwargs':kwargs |
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
def test_training_initial_weights(): | |
import torch | |
import torch.optim as optim | |
import torch.nn as nn | |
from collections import OrderedDict | |
## training config | |
#device = torch.device("cuda" if torch.cuda.is_available() else "cpu") | |
episodes = 5 | |
nb_inner_train_steps = 5 |