tensorflow - "batch size in tf.keras.preprocessing.timeseries_dataset_from_array"和 "batch size in model.fit"有什么区别?

标签 tensorflow keras time-series lstm batchsize

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

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

谢谢。

最佳答案

来自 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中指定batch size

关于tensorflow - "batch size in tf.keras.preprocessing.timeseries_dataset_from_array"和 "batch size in model.fit"有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67287240/

相关文章:

python - Keras ValueError : No data provided for "add". 需要每个键的数据:['add'] 使用模型 API

machine-learning - 如何计算keras中的错误百分比

mysql - influxdb 0.9 中两个系列的数学运算(加、除)?

python - 训练期间的 Tensorflow 常量层

docker - 用于自定义模型的 TensorFlow Serving

python - 使用 Tensorflow/Keras 的神经网络中的负二项式损失

python - 如何使用Keras API提取权重 "from input layer to hidden layer"和 "from hidden layer to output layer"?

python - CNN 模型上的文本分类

python - 将小时(00 到 23)添加到日期列

android - AChartEngine - 通过 x 读取 y 值