public MaxEntOptimizableByLabelLikelihood getOptimizable (InstanceList trainingSet) { return getOptimizable(trainingSet, getClassifier()); }
public MaxEntOptimizableByLabelLikelihood getOptimizable (InstanceList trainingSet) { return getOptimizable(trainingSet, getClassifier()); }
public MaxEntOptimizableByLabelLikelihood getOptimizable (InstanceList trainingSet) { return getOptimizable(trainingSet, getClassifier()); }
/** This method is called by the train method. * This is the main entry point for the optimizable and optimizer * compontents. */ public Optimizer getOptimizer (InstanceList trainingSet) { // If the data is not set, or has changed, // initialize the optimizable object and // replace the optimizer. if (trainingSet != this.trainingSet || optimizable == null) { getOptimizable(trainingSet); optimizer = null; } // Build a new optimizer if (optimizer == null) { // If l1Weight is 0, this devolves to // standard L-BFGS, but the implementation // may be faster. optimizer = new LimitedMemoryBFGS(optimizable); //OrthantWiseLimitedMemoryBFGS(optimizable, l1Weight); } return optimizer; }
/** This method is called by the train method. * This is the main entry point for the optimizable and optimizer * compontents. */ public Optimizer getOptimizer (InstanceList trainingSet) { // If the data is not set, or has changed, // initialize the optimizable object and // replace the optimizer. if (trainingSet != this.trainingSet || optimizable == null) { getOptimizable(trainingSet); optimizer = null; } // Build a new optimizer if (optimizer == null) { // If l1Weight is 0, this devolves to // standard L-BFGS, but the implementation // may be faster. optimizer = new LimitedMemoryBFGS(optimizable); //OrthantWiseLimitedMemoryBFGS(optimizable, l1Weight); } return optimizer; }
/** This method is called by the train method. * This is the main entry point for the optimizable and optimizer * compontents. */ public Optimizer getOptimizer (InstanceList trainingSet) { // If the data is not set, or has changed, // initialize the optimizable object and // replace the optimizer. if (trainingSet != this.trainingSet || optimizable == null) { getOptimizable(trainingSet); optimizer = null; } // Build a new optimizer if (optimizer == null) { // If l1Weight is 0, this devolves to // standard L-BFGS, but the implementation // may be faster. optimizer = new LimitedMemoryBFGS(optimizable); //OrthantWiseLimitedMemoryBFGS(optimizable, l1Weight); } return optimizer; }
public void testSetGetParameters () { MaxEntTrainer trainer = new MaxEntTrainer(); Alphabet fd = dictOfSize (6); String[] classNames = new String[] {"class0", "class1", "class2"}; InstanceList ilist = new InstanceList (new Randoms(1), fd, classNames, 20); Optimizable.ByGradientValue maxable = trainer.getOptimizable (ilist); TestOptimizable.testGetSetParameters (maxable); }
public void testRandomMaximizable () { MaxEntTrainer trainer = new MaxEntTrainer(); Alphabet fd = dictOfSize (6); String[] classNames = new String[] {"class0", "class1"}; InstanceList ilist = new InstanceList (new Randoms(1), fd, classNames, 20); Optimizable.ByGradientValue maxable = trainer.getOptimizable (ilist); TestOptimizable.testValueAndGradient (maxable); }
public void testRandomMaximizable () { MaxEntTrainer trainer = new MaxEntTrainer(); Alphabet fd = dictOfSize (6); String[] classNames = new String[] {"class0", "class1"}; InstanceList ilist = new InstanceList (new Randoms(1), fd, classNames, 20); Optimizable.ByGradientValue maxable = trainer.getOptimizable (ilist); TestOptimizable.testValueAndGradient (maxable); }
public void testSetGetParameters () { MaxEntTrainer trainer = new MaxEntTrainer(); Alphabet fd = dictOfSize (6); String[] classNames = new String[] {"class0", "class1", "class2"}; InstanceList ilist = new InstanceList (new Randoms(1), fd, classNames, 20); Optimizable.ByGradientValue maxable = trainer.getOptimizable (ilist); TestOptimizable.testGetSetParameters (maxable); }
public void testTrainedMaximizable () { MaxEntTrainer trainer = new MaxEntTrainer(); Alphabet fd = dictOfSize (6); String[] classNames = new String[] {"class0", "class1"}; InstanceList ilist = new InstanceList (new Randoms(1), fd, classNames, 20); MaxEnt me = (MaxEnt)trainer.train(ilist); Optimizable.ByGradientValue maxable = trainer.getOptimizable (ilist, me); TestOptimizable.testValueAndGradientCurrentParameters (maxable); }
public void testTrainedMaximizable () { MaxEntTrainer trainer = new MaxEntTrainer(); Alphabet fd = dictOfSize (6); String[] classNames = new String[] {"class0", "class1"}; InstanceList ilist = new InstanceList (new Randoms(1), fd, classNames, 20); MaxEnt me = (MaxEnt)trainer.train(ilist); Optimizable.ByGradientValue maxable = trainer.getOptimizable (ilist, me); TestOptimizable.testValueAndGradientCurrentParameters (maxable); }