Gluon-nlp: ConvolutionalEncoder: contradictory description of parameter `conv_layer_activation`

Created on 10 Aug 2018  路  5Comments  路  Source: dmlc/gluon-nlp

https://github.com/dmlc/gluon-nlp/blob/ca071a6dfd7ad729a50127d1e43afe417b3230b6/gluonnlp/model/convolutional_encoder.py#L63-L66

The docstring says that if nothing is specified for conv_layer_activation, no activation will be applied; however, the default is tanh, so tanh will be applied if nothing was specified. I don't think Kim et. al paper applies any activation, so the default value of this parameter should be linear in order to be consistent with the rest of the documentation.

Maybe I misinterpreted the docstring, but it's at least confusing.

bug good first issue

Most helpful comment

OK, I will open a PR.

All 5 comments

Sorry, Kim et al do use tanh.

Yes, they use tanh, but then shouldn't the description of the default behavior be changed?

Thanks for pointing out the docstring issue and no worries regarding tanh. I agree we should change the docstring. Do you want to open a PR to change it?
If so, you may also wish to change

 seq.add(nn.Activation(conv_layer_activation))

to

if conv_layer_activation is not None:
    seq.add(nn.Activation(conv_layer_activation))

or similar in
https://github.com/dmlc/gluon-nlp/blob/ca071a6dfd7ad729a50127d1e43afe417b3230b6/gluonnlp/model/convolutional_encoder.py#L117

OK, I will open a PR.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zburning picture zburning  路  3Comments

szha picture szha  路  4Comments

leezu picture leezu  路  3Comments

szha picture szha  路  6Comments

eric-haibin-lin picture eric-haibin-lin  路  5Comments