tensorlayer / TensorLayer

Deep Learning and Reinforcement Learning Library for Scientists and Engineers
http://tensorlayerx.com
Other
7.33k stars 1.61k forks source link

ActivationLayer for tensorlayer #125

Closed boscotsang closed 7 years ago

boscotsang commented 7 years ago

Suppose in resnet, there is an activation function after add the shortcut. However, in tl, ElementwiseLayer doesn't have activation function. As I know, the way to add the activation function after ElementwiseLayer is to get the outputs and then use tf.add to add the two tensor. Finally use the InputLayer to convert the tf tensor to tl layer. Is there any elegant way to do that? I think activation layer which is implemented in keras, pytorch etc. is an optional choice.

zsdonghao commented 7 years ago

hi @boscotsang , you can use LambdaLayer or simply apply activation function on net.outputs, see: resnet

boscotsang commented 7 years ago

Thanks for your help!