Class ParamOptimizer

java.lang.Object
_global.tri.oxidationstates.fitting.ParamOptimizer

public class ParamOptimizer extends Object
This class is used for optimizing the model parameters
  • Constructor Details

    • ParamOptimizer

      public ParamOptimizer(OxidationStateData data)
      Construct a parameter optimizer for a given set of training data
      Parameters:
      data - The set of training data
    • ParamOptimizer

      public ParamOptimizer(OxidationStateData data, int numThreads)
      Construct a parameter optimizer for a given set of training data and number of threads
      Parameters:
      data - The set of training data
      numThreads - The number of threads to run on (shared memory).
  • Method Details

    • batchEntries

      public OxidationStateData.Entry[][] batchEntries(int numBatches)
      Divide the entries evenly into batches, each to be handled on its own thread
      Parameters:
      numBatches - The number of batches (should match the number of threads)
      Returns:
      The entries in the training set divided evenly into batches
    • setRegularizationParameter

      public void setRegularizationParameter(double value)
      Sets the regularization parameter
      Parameters:
      value - The regularization parameter
    • getRegularizationParamaeter

      public double getRegularizationParamaeter()
      Returns the regularization parameter
      Returns:
      the regularization parameter
    • getData

      public OxidationStateData getData()
      Returns the training data
      Returns:
      the training data
    • getParameterState

      public ParamOptimizer.ParameterState getParameterState(LikelihoodCalculator calculator)
      Returns a state representing the parameters contained in the provided calculator.
      Parameters:
      calculator - The calculator containing the parameters and used to evaluate them.
      Returns:
      a state representing a current snapshot of the parameters
    • getParameterState

      public ParamOptimizer.ParameterState getParameterState(String paramFileName)
      Returns a state representing a set of parameters read from a file
      Parameters:
      paramFileName - The name of the file to read
      Returns:
      a state representing a set of parameters read from a file