Computing LM filterbank response took more than two hours

57 views
Skip to first unread message

Daniel Liu

unread,
Feb 25, 2011, 8:17:33 PM2/25/11
to cs543-spring2011-uiuc
In question 2a), we need to computer the LM response for every picture
in "train" folder, so the output size is #pictures * X_DIM * Y_DIM *
48 = 238 x 166 x 166 x 48. It took me more than two hours to do this
in Matlab. All I did was:
for all pictures (238 of them)
for j = 1:48
response(picture_index, :, :, j) = conv2(im, F(:,:,j),
'valid');

Matlab ran out of RAM after about 150 pictures after about 1.5 hours,
so my hard drive started spinning like crazy and the remainder took
forever to finish.

Has anyone else experienced this problem or am I doing something wrong?

DerekHoiem

unread,
Feb 25, 2011, 10:34:20 PM2/25/11
to cs543-spring2011-uiuc
Did you initialize "response"? If not, then every new image it will
have to create a new larger matrix to store the values. That will
make a huge difference. You could also reduce the storage requirement
by converting to "single" format, though even in double format it
should only use up about 500MB.

Best,
Derek

DerekHoiem

unread,
Feb 26, 2011, 1:41:13 AM2/26/11
to cs543-spring2011-uiuc
Sorry, I miscalculated. It uses 2.4 GB in double format, so it's a
good idea to use single format if you are going to keep all of the
filter responses in memory.

Also, you're right that it will be slow. A couple to speed it up:
(1) Downsample your filters by a factor of 2. This makes it go from
15 sec to 2-3 sec in my tests.
(2) Try running the MR8fast code from the same web site.
(3) Use a subset of the filter bank (maybe just 24 filters)

Thanks for bringing these issues to attention.

Derek
Reply all
Reply to author
Forward
0 new messages