提交 d9c97a2f authored 作者: amrithasuresh's avatar amrithasuresh

1.Removed import numpy as N

2.Updated numpy as np
上级 fe8d1292
from __future__ import absolute_import, print_function, division from __future__ import absolute_import, print_function, division
import numpy as N import numpy as np
from six.moves import xrange from six.moves import xrange
import theano import theano
...@@ -385,7 +385,7 @@ def computeR(W, b, d, H, Rshape=None): ...@@ -385,7 +385,7 @@ def computeR(W, b, d, H, Rshape=None):
# print "video size: "+str((videoHeight, videoWidth, videoDur)) # print "video size: "+str((videoHeight, videoWidth, videoDur))
R = N.zeros((batchSize, videoHeight, R = np.zeros((batchSize, videoHeight,
videoWidth, videoDur, inputChannels), dtype=H.dtype) videoWidth, videoDur, inputChannels), dtype=H.dtype)
# R[i,j,r,c,t] = b_j + sum_{rc,rk | d \circ rc + rk = r} sum_{cc,ck | ...} sum_{tc,tk | ...} sum_k W[k, j, rk, ck, tk] * H[i,k,rc,cc,tc] # R[i,j,r,c,t] = b_j + sum_{rc,rk | d \circ rc + rk = r} sum_{cc,ck | ...} sum_{tc,tk | ...} sum_k W[k, j, rk, ck, tk] * H[i,k,rc,cc,tc]
...@@ -399,12 +399,12 @@ def computeR(W, b, d, H, Rshape=None): ...@@ -399,12 +399,12 @@ def computeR(W, b, d, H, Rshape=None):
for t in xrange(0, videoDur): for t in xrange(0, videoDur):
R[i, r, c, t, j] = b[j] R[i, r, c, t, j] = b[j]
ftc = max([0, int(N.ceil( ftc = max([0, int(np.ceil(
float(t - filterDur + 1) / float(dt)))]) float(t - filterDur + 1) / float(dt)))])
fcc = max([0, int(N.ceil( fcc = max([0, int(np.ceil(
float(c - filterWidth + 1) / float(dc)))]) float(c - filterWidth + 1) / float(dc)))])
rc = max([0, int(N.ceil( rc = max([0, int(np.ceil(
float(r - filterHeight + 1) / float(dr)))]) float(r - filterHeight + 1) / float(dr)))])
while rc < outputHeight: while rc < outputHeight:
rk = r - rc * dr rk = r - rc * dr
...@@ -423,7 +423,7 @@ def computeR(W, b, d, H, Rshape=None): ...@@ -423,7 +423,7 @@ def computeR(W, b, d, H, Rshape=None):
if tk < 0: if tk < 0:
break break
R[i, r, c, t, j] += N.dot( R[i, r, c, t, j] += np.dot(
W[:, rk, ck, tk, j], H[i, rc, cc, tc, :]) W[:, rk, ck, tk, j], H[i, rc, cc, tc, :])
tc += 1 tc += 1
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论