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.
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.
Most helpful comment
OK, I will open a PR.