官术网_书友最值得收藏!

Logistic distribution

This distribution is similar to the normal distribution, but with the morphological difference of having a more elongated tail. The main importance of this distribution lies in its cumulative distribution function (CDF), which we will be using in the following chapters, and will certainly look familiar.

Let's first represent the base distribution by using the following code snippet:

    import matplotlib.pyplot as plt #Import the plot library 
import numpy as np
mu=0.5
sigma=0.5
distro2 = np.random.logistic(mu, sigma, 10000)
plt.hist(distro2, 50, normed=True)
distro = np.random.normal(mu, sigma, 10000)
plt.hist(distro, 50, normed=True)
plt.show()

Take a look at the following graph:

Logistic (red) vs Normal (blue) distribution

Then, as mentioned before, let's compute the CDF of the logistic distribution so that you will see a very familiar figure, the sigmoid curve, which we will see again when we review neural network activation functions:

    plt.figure() 
logistic_cumulative = np.random.logistic(mu, sigma, 10000)/0.02
plt.hist(logistic_cumulative, 50, normed=1, cumulative=True)
plt.show()

Take a look at the following graph:

Inverse of the logistic distribution
主站蜘蛛池模板: 襄樊市| 札达县| 临江市| 岳阳市| 五寨县| 贞丰县| 准格尔旗| 乌鲁木齐县| 汉中市| 胶州市| 河西区| 泰宁县| 衡阳市| 昭苏县| 九江市| 库尔勒市| 凤台县| 遂平县| 宜宾市| 锡林浩特市| 江油市| 佛学| 萍乡市| 闵行区| 林甸县| 鄂尔多斯市| 获嘉县| 梅州市| 上林县| 大冶市| 丹阳市| 汽车| 大理市| 河源市| 呼伦贝尔市| 改则县| 社旗县| 屯留县| 扶绥县| 信丰县| 安陆市|