public class MEMTools extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MEMTools.DualFunction
The dual function to the constraint problem of learning MEM's.
|
Modifier and Type | Field and Description |
---|---|
static byte |
BGIS
This constant can be used to specify that the model should use the blockwise iterative scaling
for training.
|
static byte |
BGIS_P
This constant can be used to specify that the model should use the blockwise iterative scaling
for training.
|
static byte |
GIS
This constant can be used to specify that the model should use the iterative scaling for
training.
|
protected static double |
LIN_EPS
The epsilon for the line search in an optimization using the
Optimizer . |
static byte |
SGIS
This constant can be used to specify that the model should use the iterative scaling for
training.
|
static byte |
SGIS_P
This constant can be used to specify that the model should use the iterative scaling for
training.
|
protected static double |
STARTDISTANCE
The start distance for the line search in an optimization using the
Optimizer . |
Constructor and Description |
---|
MEMTools() |
Modifier and Type | Method and Description |
---|---|
static double |
getExpPartOfProb(MEMConstraint[] constraints,
int[] fulfilled,
SequenceIterator sequence)
This method computes the exponential part of the probability, i.e., everything except the normalization constant.
|
static void |
setParametersToValue(MEMConstraint[] constraint,
double val)
This method is a convenience method that sets the same value for all parameter of the constraints
|
static double |
train(MEMConstraint[] constraints,
int[][] cond,
SequenceIterator sequence,
byte algorithm,
TerminationCondition condition,
OutputStream stream,
int[] alphLen)
This method approximates the distribution either analytically or numerically.
|
public static final byte SGIS_P
public static final byte BGIS_P
public static final byte GIS
public static final byte SGIS
public static final byte BGIS
protected static final double LIN_EPS
Optimizer
.protected static final double STARTDISTANCE
Optimizer
.public static double train(MEMConstraint[] constraints, int[][] cond, SequenceIterator sequence, byte algorithm, TerminationCondition condition, OutputStream stream, int[] alphLen) throws Exception
constraints
- the constraints to be usedcond
- the conditionssequence
- the SequenceIterator used in normalization and numerical approximationalgorithm
- the choice of numerical approximationcondition
- the TerminationCondition
for stopping the iterative algorithmstream
- a possibility for writing some informationalphLen
- the alphabet length of all positionsException
- if something went wrong inside the algorithmspublic static void setParametersToValue(MEMConstraint[] constraint, double val)
constraint
- the constraintsval
- the value to be setpublic static double getExpPartOfProb(MEMConstraint[] constraints, int[] fulfilled, SequenceIterator sequence)
constraints
- the constraintfulfilled
- an array allowing to store which specific constraint is used, can be null
sequence
- a sequence iteration