示例#1
0
    def __init__(self,
                 lr=1e-4,
                 beta_1=0.9,
                 beta_2=0.999,
                 epsilon=1e-8,
                 save=False,
                 rng=None,
                 *args,
                 **kwargs):
        print('args=%s' % str(args))
        print('kwargs=%s' % str(kwargs))
        super(Adam, self).__init__(**kwargs)
        self.__dict__.update(locals())
        print(locals())

        # if 'iterations' in kwargs:
        #     print('iterations=%s' % str(kwargs['iterations']))
        #     self.iterations = shared_scalar(kwargs['iterations'],  name='iteration')
        # else:
        #     print('iterations not set')
        #     self.iterations = shared_scalar(0,  name='iteration')
        self.iterations = shared_scalar(0, name='iteration')
        self.lr = shared_scalar(lr, name='lr')
        # self.rng        = MRG_RandomStreams(use_cuda=True)
        self.noise = []
        self.forget = dict()
        # self.rng        = rng
        self.beta_1 = beta_1
        self.beta_2 = beta_2
        self.epsilon = epsilon

        self.add(self.iterations)
        self.add(self.lr)
 def __init__(self,
              lr=0.05,
              momentum=0.9,
              decay=0.01,
              nesterov=True,
              *args,
              **kwargs):
     super(SGD, self).__init__(**kwargs)
     self.__dict__.update(locals())
     self.iterations = shared_scalar(0)
     self.lr = shared_scalar(lr)
     self.momentum = shared_scalar(momentum)
    def __init__(self,
                 lr=0.001,
                 beta_1=0.9,
                 beta_2=0.999,
                 epsilon=1e-8,
                 save=False,
                 rng=None,
                 *args,
                 **kwargs):
        super(Adam, self).__init__(**kwargs)
        self.__dict__.update(locals())
        print(locals())

        self.iterations = shared_scalar(0, name='iteration')
        self.lr = shared_scalar(lr, name='lr')
        self.rng = MRG_RandomStreams(use_cuda=True)
        self.noise = []
        self.forget = dict()
        self.rng = rng

        self.add(self.iterations)
        self.add(self.lr)
 def __init__(self, lr=0.1, rho=0.95, epsilon=1e-6, *args, **kwargs):
     super(Adadelta, self).__init__(**kwargs)
     self.__dict__.update(locals())
     self.lr = shared_scalar(lr)
     self.iterations = shared_scalar(0)
 def __init__(self, lr=0.01, epsilon=1e-6, *args, **kwargs):
     super(Adagrad, self).__init__(**kwargs)
     self.__dict__.update(locals())
     self.lr = shared_scalar(lr)
 def __init__(self, lr=0.001, rho=0.9, epsilon=1e-6, *args, **kwargs):
     super(RMSprop, self).__init__(**kwargs)
     self.__dict__.update(locals())
     self.lr = shared_scalar(lr)
     self.rho = shared_scalar(rho)
     self.iterations = shared_scalar(0)