如何从R中知道完成了多少个深度学习时代? [英] How do know how many deep learning epochs were done, from R?
问题描述
默认情况下,h2o.deeplearning()
的提前停止处于打开状态.但是,从R中,我如何确定它是否停止得早,以及它发生了多少个时期?我已经尝试过了:
Early stopping is turned on by default for h2o.deeplearning()
. But, from R, how do I find out if it did stop early, and how many epochs it did? I've tried this:
model = h2o.deeplearning(...)
print(model)
model = h2o.deeplearning(...)
print(model)
它告诉我有关层,MSE,R2等的信息,但与运行多少纪元无关.
which tells me information on the layers, the MSE, R2, etc. but nothing about how many epochs were run.
在Flow上,我可以看到信息(例如,"Scoring History-Deviance"图表或"Scoring History"表中x轴的位置).
Over on Flow I can see the information (e.g. where the x-axis stops in the "Scoring History - Deviance" chart, or in the Scoring History table).
推荐答案
如果您的模型称为m
,则只需获取训练的纪元数:last(m@model$scoring_history$epochs)
If your model is called m
, then to get just the number of epochs trained: last(m@model$scoring_history$epochs)
要查看还有哪些其他信息(实际上是您可以在Flow界面中看到的所有信息)以及如何访问它,请使用str(m)
To see what other information is available (which is literally everything you can see in the Flow interface) and how to access it, use str(m)
还请注意以下命令:summary(m)
除了print(m)
显示的内容外,它还添加了此部分(用于深度学习模型):
Also be aware of this command: summary(m)
In addition to what is shown with print(m)
it adds this section (for a deeplearning model):
Scoring History:
timestamp duration training_speed epochs iterations samples training_MSE training_deviance training_r2
1 2016-04-14 11:35:46 0.000 sec 0.00000 0 0.000000
2 2016-04-14 11:35:52 5.218 sec 15139 rows/sec 10.00000 1 77150.000000 0.00000 0.00000 0.07884
...
7 2016-04-14 11:36:18 31.346 sec 25056 rows/sec 100.00000 10 771500.000000 0.00000 0.00000 0.72245
即您可以通过查看最后一行来查看纪元总数.
I.e. You can see total number of epochs by looking at the last row.
顺便说一句,当应用于数据 frame 时,这与h2o的summary()
命令不同;在这种情况下,它的行为类似于R的内置摘要功能,并显示数据框中每一列的统计信息.
BTW, this is different to h2o's summary()
command when applied to a data frame; in that case it behaves like R's built-in summary function, and shows statistics on each column in the data frame.
这篇关于如何从R中知道完成了多少个深度学习时代?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!