public abstract class PositionDiffSM extends AbstractDifferentiableStatisticalModel
Sequence
,
reset()
,
next()
,
getLogScoreForInternal()
,
getLogScoreAndPartialDerivationForInternal(IntList, DoubleList)
Modifier and Type | Field and Description |
---|---|
protected int[] |
internal
This array is used for some method of
DurationDiffSM that use an internal memory |
alphabets, length, r
UNKNOWN
Modifier | Constructor and Description |
---|---|
protected |
PositionDiffSM(AlphabetContainer con,
int length)
This constructor allows create instance with more than one dimension.
|
protected |
PositionDiffSM(int min,
int max)
This is the main constructor that creates the
AlphabetContainer internally. |
protected |
PositionDiffSM(StringBuffer source)
This is the constructor for
Storable . |
Modifier and Type | Method and Description |
---|---|
PositionDiffSM |
clone()
Creates a clone (deep copy) of the current
DifferentiableSequenceScore
instance. |
protected void |
fromXML(StringBuffer xml)
This method is called in the constructor for the
Storable
interface to create a scoring function from a StringBuffer . |
void |
getInternalPosition(int[] positions)
Copies the current value of the internal iterator in the given array.
|
abstract double |
getLogScore(int... values)
This method enables the user to get the log-score without using a sequence object.
|
abstract double |
getLogScoreAndPartialDerivation(IntList indices,
DoubleList partialDer,
int... values)
This method enables the user to get the log-score and the partial derivations without using a sequence object.
|
double |
getLogScoreAndPartialDerivation(Sequence seq,
int start,
IntList indices,
DoubleList partialDer)
|
double |
getLogScoreAndPartialDerivationForInternal(IntList indices,
DoubleList partialDer)
This method enables the user to get the log-score and the partial derivations without using a sequence object by using the internal iterator.
|
double |
getLogScoreFor(Sequence seq,
int start)
|
double |
getLogScoreForInternal()
This method enables the user to get the log-score without using a sequence object by using the internal iterator.
|
protected int[] |
getValuesFromSequence(Sequence seq,
int start)
This method extracts the values form a sequence.
|
abstract boolean |
isPossible(int... positions)
This method returns
true if the given positions are in the domain of the
PositionDiffSM. |
abstract boolean |
next()
This method steps to the next reasonable outcome if possible.
|
abstract void |
reset()
This method resets the iterator to the initial state (first reasonable output) so that it can be used again.
|
StringBuffer |
toXML()
This method returns an XML representation as
StringBuffer of an
instance of the implementing class. |
emitDataSet, getInitialClassParam, getLogProbFor, getLogProbFor, getLogProbFor, getLogScoreFor, getLogScoreFor, getMaximalMarkovOrder, isNormalized, isNormalized
getAlphabetContainer, getCharacteristics, getLength, getLogScoreAndPartialDerivation, getLogScoreAndPartialDerivation, getLogScoreFor, getLogScoreFor, getNumberOfRecommendedStarts, getNumberOfStarts, getNumericalCharacteristics, toString
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addGradientOfLogPriorTerm, getESS, getLogNormalizationConstant, getLogPartialNormalizationConstant, getLogPriorTerm, getSizeOfEventSpaceForRandomVariablesOfParameter
getCurrentParameterValues, getLogScoreAndPartialDerivation, getLogScoreAndPartialDerivation, getNumberOfParameters, getNumberOfRecommendedStarts, initializeFunction, initializeFunctionRandomly, setParameters
getAlphabetContainer, getCharacteristics, getInstanceName, getLength, getLogScoreFor, getLogScoreFor, getNumericalCharacteristics, isInitialized, toString
protected int[] internal
DurationDiffSM
that use an internal memoryprotected PositionDiffSM(AlphabetContainer con, int length)
AlphabetContainer
already exists.con
- the AlphabetContainer
length
- the number of dimensions, e.g. the length of the modeled sequencesprotected PositionDiffSM(int min, int max)
AlphabetContainer
internally.min
- the minimal valuemax
- the maximal valueprotected PositionDiffSM(StringBuffer source) throws NonParsableException
source
- the XML representation as StringBuffer
NonParsableException
- if the XML representation could not be parsedpublic PositionDiffSM clone() throws CloneNotSupportedException
DifferentiableSequenceScore
DifferentiableSequenceScore
instance.clone
in interface DifferentiableSequenceScore
clone
in interface SequenceScore
clone
in class AbstractDifferentiableStatisticalModel
DifferentiableSequenceScore
CloneNotSupportedException
- if something went wrong while cloning the
DifferentiableSequenceScore
public abstract void reset()
public abstract boolean next()
true
if a next reasonable outcome could be set, otherwise false
public void getInternalPosition(int[] positions)
positions
- the array containing the internal positions after calling this methodpublic double getLogScoreForInternal()
public double getLogScoreAndPartialDerivationForInternal(IntList indices, DoubleList partialDer)
indices
- a list for the indices of the parameterspartialDer
- a list of the partial derivationspublic abstract double getLogScore(int... values)
values
- the valuespublic abstract double getLogScoreAndPartialDerivation(IntList indices, DoubleList partialDer, int... values)
indices
- a list for the indices of the parameterspartialDer
- a list of the partial derivationsvalues
- the valuespublic double getLogScoreFor(Sequence seq, int start)
SequenceScore
public double getLogScoreAndPartialDerivation(Sequence seq, int start, IntList indices, DoubleList partialDer)
DifferentiableSequenceScore
Sequence
beginning at
position start
in the Sequence
and fills lists with
the indices and the partial derivations.seq
- the Sequence
start
- the start position in the Sequence
indices
- an IntList
of indices, after method invocation the
list should contain the indices i where
partialDer
- a DoubleList
of partial derivations, after method
invocation the list should contain the corresponding
Sequence
protected int[] getValuesFromSequence(Sequence seq, int start)
seq
- the sequencestart
- the index of the startpositionpublic abstract boolean isPossible(int... positions)
true
if the given positions
are in the domain of the
PositionDiffSM.positions
- the positions to be testedtrue
if the given positions
are in the domain of the
PositionDiffSMpublic StringBuffer toXML()
Storable
StringBuffer
of an
instance of the implementing class.protected void fromXML(StringBuffer xml) throws NonParsableException
AbstractDifferentiableSequenceScore
Storable
interface to create a scoring function from a StringBuffer
.fromXML
in class AbstractDifferentiableSequenceScore
xml
- the XML representation as StringBuffer
NonParsableException
- if the StringBuffer
could not be parsedAbstractDifferentiableSequenceScore.AbstractDifferentiableSequenceScore(StringBuffer)