'Evaluate the log likelihood of multiple event sequences.
Each event sequence is evaluated from the end. If the size of the
corresponding softmax vector is 1 less than the number of events, the entire
event sequence will be evaluated (other than the first event, whose
distribution is not modeled). If the softmax vector is shorter than this,
only the events at the end of the sequence will be evaluated.
Args:
event_sequences: A list of EventSequence objects.
softmax: A list of softmax probability vectors. The list of softmaxes
should be the same length as the list of event sequences.
Returns:
A Python list containing the log likelihood of each event sequence.
Raises:
ValueError: If one of the event sequences is too long with respect to the
corresponding softmax vectors.'

def evaluate_log_likelihood(self, event_sequences, softmax):

    all_loglik = []
    for i in range(len(event_sequences)):
        if (len(softmax[i]) >= len(event_sequences[i])):
            raise ValueError(('event    sequence    must    be    longer    than    softmax    vector    (%d    events    but    softmax    vector    has    length    %d)' % (len(event_sequences[i]), len(softmax[i]))))
        end_pos = len(event_sequences[i])
        start_pos = (end_pos - len(softmax[i]))
        loglik = 0.0
        for (softmax_pos, position) in enumerate(range(start_pos, end_pos)):
            index = self.events_to_label(event_sequences[i], position)
            loglik += np.log(softmax[i][softmax_pos][index])
        all_loglik.append(loglik)
    return all_loglik
