“ML”的版本间的差异
来自个人维基
小 (→Week4 - Neural networks神经网络) |
小 (→Week4 - Neural networks神经网络) |
||
第127行: | 第127行: | ||
=Week4 - Neural networks神经网络= | =Week4 - Neural networks神经网络= | ||
[[文件:Neural_netorwk.png|400px]] | [[文件:Neural_netorwk.png|400px]] | ||
− | + | :对于上述神经网络,其各个layer可如下计算: | |
− | :<math>a_1^{(2)} = g( θ_{10}^{(1)}x_0 + θ_{11}^{(1)}x_1 + θ_{12}^{(1)}x_2 + θ_{13}^{(1)}x_3 )</math> | + | ::<math>a_1^{(2)} = g( θ_{10}^{(1)}x_0 + θ_{11}^{(1)}x_1 + θ_{12}^{(1)}x_2 + θ_{13}^{(1)}x_3 )</math> |
− | :<math>a_2^{(2)} = g( θ_{20}^{(1)}x_0 + θ_{21}^{(1)}x_1 + θ_{22}^{(1)}x_2 + θ_{23}^{(1)}x_3 )</math> | + | ::<math>a_2^{(2)} = g( θ_{20}^{(1)}x_0 + θ_{21}^{(1)}x_1 + θ_{22}^{(1)}x_2 + θ_{23}^{(1)}x_3 )</math> |
+ | ::<math>a_3^{(2)} = g( θ_{30}^{(1)}x_0 + θ_{31}^{(1)}x_1 + θ_{32}^{(1)}x_2 + θ_{33}^{(1)}x_3 )</math> | ||
+ | ::<math>h_θ(x) = a_1^{(3)} = g( θ_{10}^{(2)}a_0^{(2)} + θ_{11}^{(2)}a_1^{(2)} + θ_{12}^{(2)}a_2^{(2)} + θ_{13}^{(2)}a_3^{(2)} )</math> | ||
+ | *一个神经网络,如果其在<math>j</math>层有<math>s_j</math>个神经元,在<math>j+1</math>层有<math>s_{j+1}</math>个神经元,则<math>θ_j</math>将是 <math>s_{j+1} * (s_j+1) 的矩阵。 |
2019年1月2日 (三) 21:20的最后版本
目录[隐藏] |
定义
- 约定:
- x(i)j:训练数据中的第i列中的第j个特征值 value of feature j in the ith training example
- x(i):训练数据中第i列 the input (features) of the ith training example
- m:训练数据集条数 the number of training examples
- n:特征数量 the number of features
Week1 - 机器学习基本概念
Cost Function损失函数
Squared error function/Mean squared function均方误差:
Cross entropy交叉熵:
Gradient Descent梯度下降
对于线性回归模型,其损失函数为均方误差,故有:
对于j>=1:
Week2 - Multivariate Linear Regression
Multivariate Linear Regression模型的计算
其中,
- m为训练数据组数,n为特征个数(通常,为了方便处理,会令。
数据归一化:Feature Scaling & Standard Normalization
其中,是第i个特征数据x_i的均值,而 则要视情况而定:
- Feature Scaling:为中最大值与最小值的差(max-min);
- Standard Normalization:为中数据标准差(standard deviation)。
特别注意,通过 Feature scaling训练出模型后,在进行预测时,同样需要对输入特征数据进行归一化。
Normal Equation标准工程
Week3 - Logistic Regression & Overfitting
Logistic Regression
Sigmoid Function - S函数
Cost Function
向量化形式:
Gradient Descent
附推导过程如下:
-
- 其中,
- 由于,故有:
-
- //将 代入
-
-
- 而
- 将式3)代入式2):
- 将式4)代入式1):
- 而
向量化形式:
解决Overfitting
针对 hypothesis function,引入 Regularation parameter()到 Cost function中:
Week4 - Neural networks神经网络
- 对于上述神经网络,其各个layer可如下计算:
- 一个神经网络,如果其在层有个神经元,在层有个神经元,则将是