slinderman/nb_spiketrains — pull request #2 by mattjj (2014-11-25 03:35:16+00:00)
Title: population.log_likelihood(x) returns an array instead of a number

I made the Population classes as well as the classes in models.py and spiketrains.py act like distributions in the sense that if `x` is an array with shape `(T,N)` then their `log_likelihood(x)` methods return an array of shape `(T,)`.

I gave them each a `heldout_log_likelihood` method which just sums that to yield a `log_likelihood(x)` method that just returns a number (like a "model"). That is just a temporary patch so we don't lose any functionality.

I only tested it by running `demo_hmm_er.py`, which means almost no testing whatsoever! But they do return arrays now.

@slinderman can you glance at the diff below, especially where I just peeled off some `.sum()` calls from the code you had before?