CH05-20240912T152157Z-001.zip

how to export using notepad++

change to darkmode

show color in notepad++

Activation Functions:

image.png

Code and demo

Sigmoid function tf.nn.sigmoid

import tensorflow as tf
import matplotlib.pyplot as plt

x = tf.linspace(-10.,10,100)
y = tf.nn.sigmoid(x)
# nn means neural network

plt.plot(x,y)
plt.xlabel("x")
plt.ylabel("Sigmoid(x)")
plt.title("Sigmoid Function")
plt.grid()
plt.show()

image.png

image.png

image.png

image.png

image.png

image.png

tf.nn.tanh function

image.png

import tensorflow as tf
import matplotlib.pyplot as plt

x = tf.linspace(-10.,10,100)
y = tf.nn.tanh(x)
plt.plot(x,y)
plt.xlabel("x")
plt.ylabel("tanh(x)")
plt.title("tanh Function")
plt.grid()
plt.show()

image.png