Reputation: 145
I thought that nngraph was supposed to make writing neural networks with complex structures (for example, parallel computations) a lot easier, but I ran into some bugs..
Is the main advantage of nngraph the ability to plot the graph afterwards, and also the possibility to chain the modules quite easily?
Why do I have a bug with this:
lookup = nn.LookUpTable(...)
question = lookup(input[1])
answer = lookup(input[2])
or maybe I should do something like
question, answer = lookup({input[1],input[2]}
?
(input[1] and input[2] are just tensors containing integers) (The bug is that one of question or answer doesn't have a correct output. Dimensions are off, etc.)
Do I have to use ParallelTable even when using nngraph, in a case like this?
Upvotes: 0
Views: 92
Reputation: 145
Alright, apparently this is independent from nngraph.
What you should do in this case is clone your module, and use the clone:
lookup2 = lookup:clone()
lookup and lookup2 will share the same parameters.
Upvotes: 1