16 KiB
16 KiB
None
<html lang="en">
<head>
</head>
</html>
In [1]:
import numpy as np import pandas as pd x = np.arange(-4,4) def sigmoid(x): e = np.exp(-x) return np.divide(1,e + e) df = pd.DataFrame({"x":x,"tanh":np.tanh(x),"sigmoid":sigmoid( np.tanh(x))})
In [10]:
df[['tanh','sigmoid']].plot()
Out[10]:
<matplotlib.axes._subplots.AxesSubplot at 0x7ff349080d30>
In [ ]: