DLS Course 2 week 3 " 2.2 computing the sigmoid "

In this exe I tried to implement the function but I got some error. please help me how can I solve. this part.

" # YOUR CODE STARTS HERE

z = tf.cast("z", tf.float32)
a = tf.keras.activations.sigmoid("z")

YOUR CODE ENDS HERE "

this is what I write.

Hi @bhargav_shah and welcome to Discourse. Can you post the error you got? The function tf.keras.activations.sigmoid, documented at: tf.keras.activations.sigmoid Ā |Ā  TensorFlow Core v2.4.1, receives on input a tensor. I am not sure ā€œzā€ is a valid input to it. Is this the error you get?

Hello, @yanivh , Problem solved there is a just very small mistake I am writing this way . z = tf.cast(ā€œzā€, tf.float32)ā€¦ a = tf.keras.activations.sigmoid(ā€œzā€) but just remove the double inverted commas and problem solve.

5 Likes

There must be a variable in the bracket

1 Like

pass it as parameter not string will work