jcjohnson / densecap

Dense image captioning in Torch
MIT License
1.58k stars 430 forks source link

Why does Languagemodel creates view with -1 size, and then resized during updateoutput #16

Closed wenhuchen closed 8 years ago

wenhuchen commented 8 years ago

In the LanugageModel.lua, I noticed that when view_in, view_out are created, they took size of -1. But they resize into (N * (T + 2), -1) during UpdateOutput, in line 122/123. Is there any specific reason to do that?

wenhuchen commented 8 years ago

seems I already know the answer, is it because only in UpdateOutput function can we get the actual batch size?

jcjohnson commented 8 years ago

Yep, you figured it out =)