【问题标题】:What is the difference between "batch size in tf.keras.preprocessing.timeseries_dataset_from_array" and "batch size in model.fit"?“tf.keras.preprocessing.timeseries_dataset_from_array 中的批量大小”和“model.fit 中的批量大小”有什么区别?
【发布时间】:2021-07-21 01:02:12
【问题描述】:

正如您从本教程 (https://www.tensorflow.org/tutorials/structured_data/time_series) 中看到的那样,我正在研究时间序列的预测。

我想问一下教程第 4 节中 tf.keras.preprocessing.timeseries_dataset_from_array 中的批量大小与 model.fit 中的批量大小之间的区别。如果这两个参数相同,那么如果我也在 model.fit 中写入批量大小会发生什么?

谢谢。

【问题讨论】:

    标签: tensorflow keras time-series lstm batchsize


    【解决方案1】:

    来自model.fit 上的文档,位于here.

    batch_size: Integer or None. A number of samples per gradient update. If unspecified, 
    batch_size will default to 32. 
    Do not specify the batch_size if your data is in the form of datasets, generators,
    or keras. utils.Sequence instances (since they generate batches).
    

    所以不要在model.fit中指定批量大小

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-12-06
      • 1970-01-01
      • 2021-10-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-14
      相关资源
      最近更新 更多