Exemple #1
0
    def __init__(self, device=None, learning_rate=1e-3, act=F.relu, n_cls=10):
        super(Experiment003, self).__init__(device=device,
                                            learning_rate=learning_rate,
                                            act=act,
                                            n_cls=n_cls)

        # Loss
        self.recon_loss = ReconstructionLoss()
        self.er_loss = EntropyRegularizationLoss()
Exemple #2
0
    def __init__(self, device=None, learning_rate=1e-3, act=F.leaky_relu):
        # Settings
        self.device = device
        self.act = act
        self.learning_rate = learning_rate

        # Loss
        self.recon_loss = ReconstructionLoss()

        # Model
        from meta_st.cifar10.ref_cnn_model_000 import Model
        self.model = Model(device, act)
        self.model.to_gpu(device) if device is not None else None

        # Optimizer
        self.optimizer = optimizers.Adam(learning_rate)
        self.optimizer.setup(self.model)
        self.optimizer.use_cleargrads()
Exemple #3
0
    def __init__(self, device=None, learning_rate=1e-3, act=F.relu, T=3):
        # Settings
        self.device = device
        self.act = act
        self.learning_rate = learning_rate
        self.T = T
        self.t = 0

        # Loss
        self.recon_loss = ReconstructionLoss()

        # Model
        from meta_st.cifar10.cnn_model_001 import Model
        self.model = Model(device, act)
        self.model.to_gpu(device) if device is not None else None
        self.model_params = OrderedDict([x for x in self.model.namedparams()])

        # Optimizer
        self.setup_meta_learners()
Exemple #4
0
    def __init__(self, device=None, learning_rate=1e-3, act=F.relu, T=3):
        # Settings
        self.device = device
        self.act = act
        self.learning_rate = learning_rate

        # Loss
        self.recon_loss = ReconstructionLoss()

        # Model
        from meta_st.cifar10.cnn_model_001_small import Model
        self.model = Model(device, act)
        self.model.to_gpu(device) if device is not None else None
        self.model_params = OrderedDict([x for x in self.model.namedparams()])

        # Optimizer for model
        self.optimizer = Adam()
        self.optimizer.setup(self.model)
        self.optimizer.use_cleargrads()
        
        # Optimizer, or Meta-Learner (ML)
        self.setup_meta_learners()
Exemple #5
0
    def __init__(self, device=None, learning_rate=1e-3, act=F.leaky_relu, T=3):
        # Settings
        self.device = device
        self.act = act
        self.learning_rate = learning_rate
        self.T = 3
        self.t = 0
        self.loss_ml = 0

        # Loss
        self.rc_loss = ReconstructionLoss()

        # Model
        from meta_st.cifar10.cnn_model_001 import Model
        self.model = Model(device, act)
        self.model.to_gpu(device) if device is not None else None
        self.model_params = OrderedDict([x for x in self.model.namedparams()])

        # Optimizer
        self.optimizer = Adam(learning_rate)  #TODO: adam is appropriate?
        self.optimizer.setup(self.model)
        self.optimizer.use_cleargrads()
        self.setup_meta_learners()