de.jstacs.sequenceScores.statisticalModels.trainable.hmm.states
Class SimpleDifferentiableState

java.lang.Object
  extended by de.jstacs.sequenceScores.statisticalModels.trainable.hmm.states.SimpleState
      extended by de.jstacs.sequenceScores.statisticalModels.trainable.hmm.states.SimpleDifferentiableState
All Implemented Interfaces:
DifferentiableState, State, TrainableState

public class SimpleDifferentiableState
extends SimpleState
implements DifferentiableState

This class implements a State based on Emission that allows to reuse Emissions for different States.

Author:
Jens Keilwagen

Field Summary
 
Fields inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.hmm.states.SimpleState
e, forward, name
 
Constructor Summary
SimpleDifferentiableState(DifferentiableEmission e, String name, boolean forward)
          This is the constructor of a SimpleState.
 
Method Summary
 double getLogScoreAndPartialDerivation(int startPos, int endPos, IntList indices, DoubleList partDer, Sequence seq)
          This method allows to compute the logarithm of the score and the gradient for the given subsequences.
 
Methods inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.hmm.states.SimpleState
addToStatistic, getGraphvizNodeOptions, getLogScoreFor, isSilent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.jstacs.sequenceScores.statisticalModels.trainable.hmm.states.State
getGraphvizNodeOptions, getLogScoreFor, isSilent, toString
 

Constructor Detail

SimpleDifferentiableState

public SimpleDifferentiableState(DifferentiableEmission e,
                                 String name,
                                 boolean forward)
This is the constructor of a SimpleState.

Parameters:
e - the emission that is internally used for scoring subsequences
name - the name of the state
forward - a switch that decides whether to use the forward or the reverse complementary strand of a sequence
Method Detail

getLogScoreAndPartialDerivation

public double getLogScoreAndPartialDerivation(int startPos,
                                              int endPos,
                                              IntList indices,
                                              DoubleList partDer,
                                              Sequence seq)
                                       throws WrongLengthException,
                                              OperationNotSupportedException
Description copied from interface: DifferentiableState
This method allows to compute the logarithm of the score and the gradient for the given subsequences.

Specified by:
getLogScoreAndPartialDerivation in interface DifferentiableState
Parameters:
startPos - the start position (inclusive)
endPos - the end position (inclusive)
indices - a list for the parameter indices
partDer - a list for the partial derivations
seq - the Sequence(s)
Returns:
the logarithm of the score
Throws:
WrongLengthException - if the length can not be modeled
OperationNotSupportedException - if the reverse complement of the sequence can not be computed