Class ParameterLearningOptions
- java.lang.Object
-
- com.bayesserver.learning.parameters.ParameterLearningOptions
-
-
Constructor Summary
Constructors Constructor Description ParameterLearningOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getCalculateStatistics()
Gets a value indicating whether to calculate summary statistics in an extra iteration at the end of learning.Cancellation
getCancellation()
Gets of sets the instance implementingCancellation
, used for cancellation.ConvergenceMethod
getConvergenceMethod()
Gets the method used to determine convergence of the learning algorithm.DecisionPostProcessingMethod
getDecisionPostProcessing()
Gets the post processing method for decision nodes.InitializationOptions
getInitialization()
Options for initialization.Integer
getMaximumConcurrency()
Gets the maximum number of inference engines used during learning.int
getMaximumIterations()
Gets the maximum number of iterations that parameter learning will perform.boolean
getMonitorLogLikelihood()
Calculates the log likelihood at each iteration.Priors
getPriors()
Contains parameters used to avoid boundary conditions during learning.ParameterLearningProgress
getProgress()
Gets of sets the instance implementingParameterLearningProgress
, used for progress notifications.boolean
getSaveHyperparameters()
Gets a value indicating whether hyperparameters (e.g.Integer
getSeed()
Gets the seed used to generate random numbers for initialization.Stop
getStopping()
Gets the instance implementingStop
used for early stopping.TimeSeriesMode
getTimeSeriesMode()
Gets the mode in which time series distributions are learned.Double
getTolerance()
Gets the tolerance used to determine whether or not parameter learning has converged.double
getToleranceOrDefault()
If Tolerance is null, this returns the default tolerance for the given convergence method, otherwise Tolerance is returned.void
setCalculateStatistics(boolean value)
Sets a value indicating whether to calculate summary statistics in an extra iteration at the end of learning.void
setCancellation(Cancellation value)
Gets of sets the instance implementingCancellation
, used for cancellation.void
setConvergenceMethod(ConvergenceMethod value)
Sets the method used to determine convergence of the learning algorithm.void
setDecisionPostProcessing(DecisionPostProcessingMethod value)
Sets the post processing method for decision nodes.void
setMaximumConcurrency(Integer value)
Sets the maximum number of inference engines used during learning.void
setMaximumIterations(int value)
Sets the maximum number of iterations that parameter learning will perform.void
setMonitorLogLikelihood(boolean value)
Calculates the log likelihood at each iteration.void
setProgress(ParameterLearningProgress value)
Gets of sets the instance implementingParameterLearningProgress
, used for progress notifications.void
setSaveHyperparameters(boolean value)
Sets a value indicating whether hyperparameters (e.g.void
setSeed(Integer value)
Sets the seed used to generate random numbers for initialization.void
setStopping(Stop value)
Sets the instance implementingStop
used for early stopping.void
setTimeSeriesMode(TimeSeriesMode value)
Sets the mode in which time series distributions are learned.void
setTolerance(Double value)
Sets the tolerance used to determine whether or not parameter learning has converged.
-
-
-
Method Detail
-
getMaximumConcurrency
public Integer getMaximumConcurrency()
Gets the maximum number of inference engines used during learning.During learning, multiple inference engines may be used in parallel. However each inference engine has its own memory requirements for inference, and so this parameter allows the number to be limited, to avoid excessive memory consumption. The amount of memory used per inference engine, depends on the
Network
and also the data.
-
setMaximumConcurrency
public void setMaximumConcurrency(Integer value)
Sets the maximum number of inference engines used during learning.During learning, multiple inference engines may be used in parallel. However each inference engine has its own memory requirements for inference, and so this parameter allows the number to be limited, to avoid excessive memory consumption. The amount of memory used per inference engine, depends on the
Network
and also the data.
-
getConvergenceMethod
public ConvergenceMethod getConvergenceMethod()
Gets the method used to determine convergence of the learning algorithm.
-
setConvergenceMethod
public void setConvergenceMethod(ConvergenceMethod value)
Sets the method used to determine convergence of the learning algorithm.
-
getCalculateStatistics
public boolean getCalculateStatistics()
Gets a value indicating whether to calculate summary statistics in an extra iteration at the end of learning.- Returns:
- When
true
statistics are calculated.
-
setCalculateStatistics
public void setCalculateStatistics(boolean value)
Sets a value indicating whether to calculate summary statistics in an extra iteration at the end of learning.- Parameters:
value
- Whentrue
statistics are calculated.
-
getSaveHyperparameters
public boolean getSaveHyperparameters()
Gets a value indicating whether hyperparameters (e.g. experience tables) should be saved to the network. Hyperparameters such as experience tables can be used for online learning (adaptation).
-
setSaveHyperparameters
public void setSaveHyperparameters(boolean value)
Sets a value indicating whether hyperparameters (e.g. experience tables) should be saved to the network. Hyperparameters such as experience tables can be used for online learning (adaptation).
-
getMonitorLogLikelihood
public boolean getMonitorLogLikelihood()
Calculates the log likelihood at each iteration.False
by default, as it can be expensive to calculate. This property does not effect the output of statistics on completion of learning.
-
setMonitorLogLikelihood
public void setMonitorLogLikelihood(boolean value)
Calculates the log likelihood at each iteration.False
by default, as it can be expensive to calculate. This property does not effect the output of statistics on completion of learning.
-
getPriors
public Priors getPriors()
Contains parameters used to avoid boundary conditions during learning.
-
getSeed
public Integer getSeed()
Gets the seed used to generate random numbers for initialization. Only valid whengetMaximumConcurrency()
is 1 and when not distributed.
-
setSeed
public void setSeed(Integer value)
Sets the seed used to generate random numbers for initialization. Only valid whengetMaximumConcurrency()
is 1 and when not distributed.
-
getInitialization
public InitializationOptions getInitialization()
Options for initialization. Note that aDistributionSpecification
can override certain initialization values.
-
getDecisionPostProcessing
public DecisionPostProcessingMethod getDecisionPostProcessing()
Gets the post processing method for decision nodes.
-
setDecisionPostProcessing
public void setDecisionPostProcessing(DecisionPostProcessingMethod value)
Sets the post processing method for decision nodes.
-
getTimeSeriesMode
public TimeSeriesMode getTimeSeriesMode()
Gets the mode in which time series distributions are learned.
-
setTimeSeriesMode
public void setTimeSeriesMode(TimeSeriesMode value)
Sets the mode in which time series distributions are learned.
-
getMaximumIterations
public int getMaximumIterations()
Gets the maximum number of iterations that parameter learning will perform. The parameter learning algorithm can perform fewer iterations that this maximum, if convergence is detected using thegetTolerance()
.- Returns:
- Maximum iterations.
-
setMaximumIterations
public void setMaximumIterations(int value)
Sets the maximum number of iterations that parameter learning will perform. The parameter learning algorithm can perform fewer iterations that this maximum, if convergence is detected using thegetTolerance()
.- Parameters:
value
- Maximum iterations.
-
getStopping
public Stop getStopping()
Gets the instance implementingStop
used for early stopping. Stopping is different to cancellation, as stopping will still complete the learning process, albeit having performed fewer iterations.- Returns:
- The instance used for stopping.
-
setStopping
public void setStopping(Stop value)
Sets the instance implementingStop
used for early stopping. Stopping is different to cancellation, as stopping will still complete the learning process, albeit having performed fewer iterations.- Parameters:
value
- The instance used for stopping.
-
getCancellation
public Cancellation getCancellation()
Gets of sets the instance implementingCancellation
, used for cancellation.- See Also:
Cancellation
-
setCancellation
public void setCancellation(Cancellation value)
Gets of sets the instance implementingCancellation
, used for cancellation.- See Also:
Cancellation
-
getProgress
public ParameterLearningProgress getProgress()
Gets of sets the instance implementingParameterLearningProgress
, used for progress notifications.- See Also:
ParameterLearningProgress
-
setProgress
public void setProgress(ParameterLearningProgress value)
Gets of sets the instance implementingParameterLearningProgress
, used for progress notifications.- See Also:
ParameterLearningProgress
-
getToleranceOrDefault
public double getToleranceOrDefault()
If Tolerance is null, this returns the default tolerance for the given convergence method, otherwise Tolerance is returned.- Returns:
-
getTolerance
public Double getTolerance()
Gets the tolerance used to determine whether or not parameter learning has converged. This is a non negative number which indicates that parameter learning will only stop when the relative difference between parameters or log-likelihood between iterations is no greater than this value.When null, a default value is used which depends on the Convergence Method in use.
- Returns:
- The tolerance.
-
setTolerance
public void setTolerance(Double value)
Sets the tolerance used to determine whether or not parameter learning has converged. This is a non negative number which indicates that parameter learning will only stop when the relative difference between parameters or log-likelihood between iterations is no greater than this value.When null, a default value is used which depends on the Convergence Method in use.
- Parameters:
value
- The tolerance.
-
-