Class EmissionCache

    • Method Detail

      • getEmissions

        public final double[] getEmissions​(List symList,
                                           boolean exorcise)
                                    throws IllegalSymbolException
        Retrieve the emission scores from the cache for every EmissionState for the specified symbols. The scores will be computed and cached if not already available.

        The correct behaviour should be to exclude emission from the MagicalState except at the origin and bottom-right of the DP matrix. As such, the emission vector is only cached when it it is computed for exorcise set to true. The vector is computed afresh every time when exorcise is false. it should be noted that if exorcise is NOT set to false with the emission vector at the ends of the matrix, the model will fail as the start and and end transitions become impossible.

        Parameters:
        symList - a list of the symbols in each head that require a lookup for emission probabilities.
        exorcise - Prevents emission from the MagicalState.
        Throws:
        IllegalSymbolException
      • clear

        public void clear()