Skip to content

Commit

Permalink
Fixed the Value error in Example from activation.py
Browse files Browse the repository at this point in the history
Passing Python list directly to the keras layer object in Example from activation.py is throwing Value error.  Fixed the error by passing tensor as a input. Here is the [gist](https://colab.sandbox.google.com/gist/LakshmiKalaKadali/caefd982bfff4ff6c4139784236c3a17/quickstart_colab.ipynb#scrollTo=F3hV2zfCb7Nu).

Thank You
  • Loading branch information
LakshmiKalaKadali authored Oct 24, 2024
1 parent d4bb8e3 commit e5451e5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions keras/src/layers/activations/activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ class Activation(Layer):
Example:
>>> layer = keras.layers.Activation('relu')
>>> layer([-3.0, -1.0, 0.0, 2.0])
>>> input_data = np.array([-3.0, -1.0, 0.0, 2.0])
>>> result = layer(input_data)
>>> print(result)
[0.0, 0.0, 0.0, 2.0]
>>> layer = keras.layers.Activation(keras.activations.relu)
>>> layer([-3.0, -1.0, 0.0, 2.0])
>>> input_data = np.array([-3.0, -1.0, 0.0, 2.0])
>>> result = layer(input_data)
>>> print(result)
[0.0, 0.0, 0.0, 2.0]
"""

Expand Down

0 comments on commit e5451e5

Please sign in to comment.