kimiyoung / review_net

Review Network for Caption Generation
MIT License
182 stars 57 forks source link

question about combine parameters #5

Open vanpersie32 opened 7 years ago

vanpersie32 commented 7 years ago

Hello, I have a little question here: https://github.com/kimiyoung/review_net/blob/master/image_caption_offline/utils/model_utils.lua#L5 I know the function combines of many models, but it is so complex... Why not set up a container and put all models into it and use the get parameters of the container? For example, If I want to combine parameters of model1,model2,model3 fake_net=nn.Sequential():add(model1):add(model2):add(model3) parameters,gradients=fake_net:getParameters()