Ejemplo n.º 1
0
    def train(self, dataset, trainbags):

        self.bagnames = dataset.getBagNames()

        self.state = self.initialize(dataset, trainbags)

        gd = GradientDescent(self.lrate,
                             self.logPosterior, self.grad_logPosterior,
                             self.state.vectorize(), (dataset, trainbags),
                             self.max_iter, sys.stdout)
        state_vec = gd.minimize()

        self.state = self.state.devectorize(state_vec)

        if self.islearnthres == 1:
            self.learnThres(dataset, trainbags)
Ejemplo n.º 2
0
    def train(self,dataset,trainbags):

        self.bagnames = dataset.getBagNames()
                       
        self.state = self.initialize(dataset,trainbags)
        
                    

        gd = GradientDescent(self.lrate,self.logPosterior,self.grad_logPosterior,self.state.vectorize(),(dataset,trainbags),self.max_iter, sys.stdout)        
        state_vec = gd.minimize()

        
        self.state = self.state.devectorize(state_vec)    
        
        if self.islearnthres==1:
            self.learnThres(dataset,trainbags)
Ejemplo n.º 3
0
 def __init__(self,learningrate, func, dfunc, Xinit, args, maxiter,outfilename):
     
     GradientDescent.__init__(self,learningrate, func, dfunc, Xinit, args, maxiter,outfilename)
Ejemplo n.º 4
0
    def __init__(self, learningrate, func, dfunc, Xinit, args, maxiter,
                 outfilename):

        GradientDescent.__init__(self, learningrate, func, dfunc, Xinit, args,
                                 maxiter, outfilename)