Documentation of 'cc.mallet.fst.ThreadedOptimizable' Java class
ThreadedOptimizable
cc.mallet.fst

Class ThreadedOptimizable

    • Constructor Detail

      • ThreadedOptimizable

        public ThreadedOptimizable(Optimizable.ByCombiningBatchGradient optimizable,
                                   InstanceList trainingSet,
                                   int numFactors,
                                   CacheStaleIndicator cacheIndicator)
        Initializes the optimizable and starts new threads.
        Parameters:
        optimizable - Optimizable to be parallelized
        numFactors - Number of factors in model's parameters, used to initialize the gradient
        cacheIndicator - Determines when value/gradient become stale
    • Method Detail

      • shutdown

        public void shutdown()
        Shuts down the executor used to start and run threads to compute values and gradients.

        *Note*: For a clean exit of all the threads, it is recommended to call this method after training finishes.

      • getValueGradient

        public void getValueGradient(double[] buffer)
        Returns the gradient, re-computes if gradient is stale.

        *Note*: Assumes that buffer is already initialized.

        Specified by:
        getValueGradient in interface Optimizable.ByGradientValue
      • setParameter

        public void setParameter(int index,
                                 double value)
        Specified by:
        setParameter in interface Optimizable

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.