是的,代码中有数据增强。在训练集中,使用了ImageDataGenerator函数,其中指定了rescale参数为1./255,将像素值缩放到0-1之间,并且指定了horizontal_flip参数为True,对图片进行水平翻转操作。在测试集中,只使用了rescale参数将像素值缩放到0-1之间。

import osimport numpy as npimport pandas as pdimport tensorflow as tfimport matplotlibpyplot as pltfrom tensorflowkerasmodels import Sequential Modelfrom tensorflowkeraslayers import Dense Conv2D Flat

原文地址: https://www.cveoy.top/t/topic/fOlo 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录