Exemplo 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()))
Exemplo n.º 2
0
Arquivo: rnn.py Projeto: 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()))
Exemplo n.º 3
0
Arquivo: nnjm.py Projeto: 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)