关于训练H2o自编码器的时间问题

huangapple go评论47阅读模式
英文:

Time issues with training a H2o Autoencoder

问题

我在想是否有人知道我的H2o自动编码器在训练过程中是否存在任何明显的问题,可能会导致它训练时间如此之长?或者是否有人知道我如何可以减少训练这个模型所需的时间,无论是在数据集还是模型构建方面。任何帮助将不胜感激!非常感谢!

我一直在对一个只包含独热编码分类列的数据集上训练H2o自动编码器。数据集的形状为(7762,2232),模型训练大约需要5小时。构建模型的代码如下:

model = H2ODeepLearningEstimator(
    autoencoder = True,
    seed = -1
    hidden = [2000,1000,500,250,125,50],
    epochs = 30,
    activation = "Tanh"
)
英文:

I was wondering if anyone knows if there are any glaring problems with the way my H2o autoencoder is being trained that could cause it to take so long? Or if anyone knows of any way I can reduce the time it takes to train this model, both with the dataset and the model construction. Any help would be greatly appreciated! Thank you very much!

I have been training a H2o autoencoder on a dataset consisting of just one-hot-encoded categorical columns. The dataset is of shape (7762,2232) and the model took about 5 hours to train. The code for building the model is as follows:

model = H2ODeepLearningEstimator(
    autoencoder = True,
    seed = -1
    hidden = [2000,1000,500,250,125,50],
    epochs = 30,
    activation = "Tanh"
)

答案1

得分: 1

问题在于列的数量。虽然行数控制整体训练时间,但列的数量控制每行的训练时间。有2232列相当多。如果您可以进行一些数据处理并减少使用的预测变量数量,肯定会加快训练速度。

您还可以尝试以下方法:

  1. 将stopping_tolerance设置为更高的数字:0.1或更高。这将启用提前停止,如果某些指标的平均改善与上次相比没有提高0.1,则停止训练;
  2. 如果要在120秒后停止模型构建,可以将max_runtime_secs设置为120;
  3. 将score_training_samples从默认值10000减少到5000。这将在较少数量的样本上执行评分,从而可以减少训练时间。

请注意,像1、2中提前停止模型可能会减少模型的训练时间,但可能不适合您的数据。

英文:

The problem here is the number of columns. While the number of rows control the overall training time, the number of columns control the training time per row. Having 2232 is quite a lot. If you can do some data munging and reduce the number of predictors you use, it will definitely speed up training.

You can also try the following:

  1. set stopping_tolerance to a higher number: 0.1 or higher. This will enable early stopping to stop training if the average improvement in some metrics does not improve by 0.1 compared to the last one;
  2. set max_runtime_secs=120 if you want to stop the model building after 120 seconds
  3. reduce score_training_samples from default of 10000 to say 5000. This will perform scoring on a smaller number of samples and hence can reduce training time.

Note that stopping the model early as in 1, 2 may reduce the model training time but will get you a model that may not be a good fit for your data.

huangapple
  • 本文由 发表于 2023年6月8日 13:24:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/76428833.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定