public interface DifferentiableTransition extends Transition
Optimizer
.Modifier and Type | Method and Description |
---|---|
void |
addGradientForLogPriorTerm(double[] gradient,
int start)
This method computes the gradient of
Transition.getLogPriorTerm() for each
parameter of this transition. |
void |
fillParameters(double[] params)
This method allows to fill the parameters of the transition in a given array.
|
void |
fillSamplingGroups(int parameterOffset,
LinkedList<int[]> list)
Adds the groups of indexes of those parameters of this transition that should be sampled
together in one step of a grouped sampling procedure, each as an
int[] , into list . |
double |
getLogScoreAndPartialDerivation(int layer,
int index,
int childIdx,
IntList indices,
DoubleList partDer,
Sequence sequence,
int sequencePosition)
This method allows to compute the logarithm of the score and the gradient for a specific transition.
|
int |
getSizeOfEventSpace(int index)
Returns the size of the event space, i.e., the number of possible outcomes,
for the random variable of parameter
index |
int |
setParameterOffset(int offset)
This method sets the internal offset of the parameter index.
|
void |
setParameters(double[] params,
int start)
This method allows to set the parameters of the transition.
|
clone, fillTransitionInformation, getChildIdx, getGraphizNetworkRepresentation, getLastContextState, getLogPriorTerm, getLogScoreFor, getMaximalInDegree, getMaximalMarkovOrder, getMaximalNumberOfChildren, getNumberOfChildren, getNumberOfIndexes, getNumberOfStates, hasAnySelfTransitions, initializeRandomly, isAbsoring, setParameters, toString
int setParameterOffset(int offset)
offset
- the offsetvoid setParameters(double[] params, int start)
params
- the parametersstart
- the (global) start positionvoid fillParameters(double[] params)
params
- the parametersdouble getLogScoreAndPartialDerivation(int layer, int index, int childIdx, IntList indices, DoubleList partDer, Sequence sequence, int sequencePosition)
layer
- the layer of the matrixindex
- the index encoding the contextchildIdx
- the index of the childindices
- a list for the parameter indicespartDer
- a list for the partial derivationssequencePosition
- the position within the sequencesequence
- the sequenceTransition.getLogScoreFor(int, int, int, Sequence, int)
void addGradientForLogPriorTerm(double[] gradient, int start)
Transition.getLogPriorTerm()
for each
parameter of this transition. The results are added to the array
gradient
beginning at index start
.gradient
- the array of gradientsstart
- the start index in the gradient
array, where the
partial derivations for the parameters of this Transition
shall be
enteredint getSizeOfEventSpace(int index)
index
index
- the index of the parametervoid fillSamplingGroups(int parameterOffset, LinkedList<int[]> list)
int[]
, into list
.
In most cases, one group should contain the
parameters that are living on a common simplex, e.g. the parameters of one TransitionElement
of this transition. The internal indexes of the parameters are incremeneted by an external parameterOffset
parameterOffset
- the external parameter offsetlist
- the list of sampling groups