



























So I seem to keep writing commands that look like this:
delta[t][q] = max(
[delta[tau][j] +
pylab.log(
pylab.array([
output_dist(Q=q,L=(t-tau),Y=Y[tau+1:t]),
duration_dist(Q=q,L=(t-tau)),
transition_dist[q,j]]).prod())
for j in self.state_range])
Is this bad? The above is the max of a list. The list is made up using a list comprehension, where each element is the log of a product of a 1D array plus a bit. Each element of each array is a call to a function associated with my model. The trouble is, if I break it down into some for loops, then I start having to invent temporary names for my variables, which seems clunky.
Any opinions?
M
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。