Open tomaszjacek opened 2 weeks ago
Mr. Professor,
When I'm trying
@tf.function def smish(input): return input * tf.math.tanh(tf.math.log(1+tf.math.sigmoid(input)))
class Smish(layers.Layer):
def __init__(self, input): """ Init method. """ super().__init__() def call(self, input): """ Forward pass of the function. """ return smish(input)
than in model declaration
self_conv2D_11 = Conv2D(16 , kernel_size=(3,3),strides=(1,1),padding = 'same')
activation_9 = Smish(conv2D_1) conv2D_11 = self_conv2D_11(activation_9)
i got an error TypeError: Inputs to a layer should be tensors. Got: <main.Smish object at 0x000001F82C4FE910>
Would you be so kind to give hint how to translate Smish to tensorflow ?
Thank you, tj
it works, just need to change def init(self, input): to def init(self): and declare first self_activation_9 = Smish() than use it as activation_9 = self_activation_9(conv2D_1)
Mr. Professor,
When I'm trying
@tf.function def smish(input): return input * tf.math.tanh(tf.math.log(1+tf.math.sigmoid(input)))
class Smish(layers.Layer):
than in model declaration
self_conv2D_11 = Conv2D(16 , kernel_size=(3,3),strides=(1,1),padding = 'same')
activation_9 = Smish(conv2D_1) conv2D_11 = self_conv2D_11(activation_9)
i got an error TypeError: Inputs to a layer should be tensors. Got: <main.Smish object at 0x000001F82C4FE910>
Would you be so kind to give hint how to translate Smish to tensorflow ?
Thank you, tj