【文件属性】:
文件名称:matlab均方误差的代码-matlab-nn:从零开始的神经网络。事实证明Matlab支持OOP
文件大小:231KB
文件格式:ZIP
更新时间:2021-05-23 09:25:43
系统开源
matlab均方误差的代码〜深度学习〜
使用Matlab前馈MLP库。
出于可读性而非性能而编写。
目录结构
nn/
:库代码
util/
:用于绘图,权重初始化等的scrappy实用程序功能。
examples/
:使用lib进行NN分类和回归的示例
可用的损失函数
均方误差:
mean_squared_error
=
@(y_hat,y)
(1/size(y_hat,1))
*
sum((y_hat-y).^2);
mean_squared_error_gradient
=
@(y_hat,y)
(1/size(y_hat,1))*2*(y_hat-y);
交叉熵损失:
cross_entropy_loss
=
@(y_hat,y)
(1/size(y_hat,1))
*
...
sum(-(y
.*
log(y_hat))
...
-
(1-y)
.*
log(1-y_hat));
cross_entropy_loss_gradient
=
@(y_hat,y)
(1/size(y_hat,1))
*
(y_hat-y);
在nn/ErrorFunctions.m添加自定义损失函
【文件预览】:
matlab-nn-master
----nn()
--------ErrorFunctions.m(892B)
--------LinearLayer.m(2KB)
--------Loss.m(543B)
--------ActivationLayer.m(2KB)
--------NN.m(2KB)
--------train.m(1KB)
----examples()
--------figures()
--------nn_regression_example.m(2KB)
--------nn_classification_example.m(3KB)
----util()
--------Util.m(2KB)
----README.md(2KB)