You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2017/12/05 19:21:36 UTC

[GitHub] piiswrong commented on issue #8943: how to share parameters while my network is a bit fancy?

piiswrong commented on issue #8943: how to share parameters while my network is a bit fancy?
URL: https://github.com/apache/incubator-mxnet/issues/8943#issuecomment-349412104
 
 
   Change mynn to
   
   ```
   self.net1 = Net()
   self.net2 = Net(params=self.net1.collect_params())
   ```
   
   But you actually don't need net1 and net2, you can just do
   ```
       def forward(self, x1 , x2):
           x = self.net(x1) - self.net(x2)
           x = self.net3(x)
           return x
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services