2017-07-03 66 views
0

我用h2o(如下)构建了一个简单的深度学习回归模型。该模型预测R虹膜数据集中的萼片长度。我注意到,随着我增加时期,模型精度(r^2)增加(图1)。时代如何影响深度学习模式?

通过增加时代的数量,我会过度拟合以有害的方式模型还是我增加一个有益的方式模型的准确性?

library(datasets) 
library(h2o) 

df <- iris 

df.hex <- as.h2o(df) 

model <- h2o.deeplearning(x = 2:5, y = 1, df.hex, 
          hidden = c(200, 200, 200, 200, 200), 
          epochs = 5, 
          variable_importances=T) 

perf_dl <- h2o.performance(model) 
rsq_dl <- h2o.r2(perf_dl) 


图1

enter image description here

# Note this code plots the data from the deep learning runs in the previous code 
library(ggplot2) 

df <- data.frame(epochs = c(5, 10, 100, 300, 500, 1000, 2000, 3000, 5000), rsq = c(0.77, 0.70, 0.57, 0.75, 0.87, 0.92, 0.97, 0.96, 0.98)) 

p <- ggplot(df, aes(epochs, rsq)) 
p + geom_point(aes(size = 7)) + stat_smooth(method = "lm", formula = y ~ x + I(x^2), size = 1) 
+0

这是一个很小的玩具数据集,你无法通过在其上运行实验来真正判断学习的深度。你有5个隐藏层,每个人有更多的神经元比数据集有行。这不是一个好的用例。 – TomKraljevic

回答

1

其通常在这种情况下示出的典型的图像是

enter image description here

请注意,甜蜜点(图片中的50个时期)取决于网络,问题和数据。确定何时停止是一个未解决的问题,但提前停止是一种流行的选择。

来源:我尚未发表,但完成硕士论文。由于我大学的官僚主义原因,现在不公开。

+0

有趣的是,我没有注意到随着时代的增加,误差增加。 – Borealis

+0

@Borealis事实并非如此。但通常。 –

相关问题