Esempio n. 1
0
    def __init__(self, dset, hps, opt_hps, train=True, opt='nag'):

        super(RNN, self).__init__(dset, hps, train=train)
        self.nl = get_nl(hps.nl)

        self.alloc_params()
        self.alloc_grads()

        if train:
            self.opt = create_optimizer(opt, self, **(opt_hps.to_dict()))
Esempio n. 2
0
File: rnn.py Progetto: comadan/nn
    def __init__(self, dset, hps, opt_hps, train=True, opt='nag'):

        super(RNN, self).__init__(dset, hps, train=train)
        self.nl = get_nl(hps.nl)

        self.alloc_params()
        self.alloc_grads()

        if train:
            self.opt = create_optimizer(opt, self, **(opt_hps.to_dict()))
Esempio n. 3
0
File: nnjm.py Progetto: comadan/nn
    def __init__(self, dset, hps, opt_hps, train=True, opt='nag'):

        super(NNJM, self).__init__(dset, hps, train=train)
        self.ctc_loader = CTCLoader(SOURCE_CONTEXT*NUM_CHARS, dset.batch_size, dset.subset)
        self.nl = get_nl(hps.nl)

        self.alloc_params()

        if train:
            self.opt = create_optimizer(opt, self, alpha=opt_hps.alpha,
                    mom=opt_hps.mom, mom_low=opt_hps.mom_low,
                    low_mom_iters=opt_hps.low_mom_iters)