我认为萨尔瓦多在这里意味着不可能分析计算最适合的批量大小,但是,因为所有东西都在ML中,它只是另一个超参数,可以添加到您的网格搜索中以自动计算 . 只需评估您的模型's loss or accuracy (however you measure performance) for the best and most stable (least variable) measure given several batch sizes, say some powers of 2, such as 64, 256, 1024, etc. Then keep use the best found batch size. Note that batch size can depend on your model' s架构,机器硬件等 . 例如,如果您将建模从本地PC移动到某个 Cloud 计算引擎(GCP,AWS,Azure,...),那么批量大小太大对于你的PC来说RAM很容易适用于几乎无限的RAM / CPU / GPU(注意成本) .
2 回答
不,不可能自动执行此操作 . 因此,如果您希望尽可能多地使用批次,则需要经过大量的试验和错误才能找到合适的尺寸 .
Stanford's CNN class提供了一些如何估计内存大小的指导,但所有建议都与CNN有关(不确定你训练什么) .
我认为萨尔瓦多在这里意味着不可能分析计算最适合的批量大小,但是,因为所有东西都在ML中,它只是另一个超参数,可以添加到您的网格搜索中以自动计算 . 只需评估您的模型's loss or accuracy (however you measure performance) for the best and most stable (least variable) measure given several batch sizes, say some powers of 2, such as 64, 256, 1024, etc. Then keep use the best found batch size. Note that batch size can depend on your model' s架构,机器硬件等 . 例如,如果您将建模从本地PC移动到某个 Cloud 计算引擎(GCP,AWS,Azure,...),那么批量大小太大对于你的PC来说RAM很容易适用于几乎无限的RAM / CPU / GPU(注意成本) .