You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mxnet.apache.org by "Lauly, Stanislas" <la...@amazon.com.INVALID> on 2019/03/07 22:16:21 UTC

"If" function in MXNET and sharing parameters

Hi,

About MXNET module, I need to create a model that use a different input matrix depending on the actual input, is there a kind of “if” that can be part of the computational graph? If not, I can always create multiple models that share some params between them, but doing so does not sound trivial. I found this:

https://discuss.mxnet.io/t/sharing-parameters-between-two-modules-through-arg-dict/1046

But it looks like it is not very efficient. Is there a better way to share parameters between models?


Stanislas Lauly
Applied scientist – Amazon AI

Re: "If" function in MXNET and sharing parameters

Posted by Haibin Lin <ha...@gmail.com>.
Hi Stanislas,

Did you consider nd/symbol.contrib.cond for conditional statement?
https://mxnet.incubator.apache.org/versions/master/tutorials/control_flow/ControlFlowTutorial.html

Best,
Haibin

On Fri, Mar 8, 2019 at 10:29 Lauly, Stanislas <la...@amazon.com.invalid>
wrote:

> Hi,
>
> About MXNET module, I need to create a model that use a different input
> matrix depending on the actual input, is there a kind of “if” that can be
> part of the computational graph? If not, I can always create multiple
> models that share some params between them, but doing so does not sound
> trivial. I found this:
>
>
> https://discuss.mxnet.io/t/sharing-parameters-between-two-modules-through-arg-dict/1046
>
> But it looks like it is not very efficient. Is there a better way to share
> parameters between models?
>
>
> Stanislas Lauly
> Applied scientist – Amazon AI
>