陕西西安,潍坊网站seo外包,百度seo排名优,邢台市网站建设Resistor Ohm Value Estimation Challenge
需要将误差降低到1%以下
1、调整模型架构#xff1a;增加模型的复杂性#xff0c;例如增加卷积层或全连接层的数量#xff0c;增加神经元数量等
# 在 ResistorEstimator 类的 CNN 方法中进行修改
def CNN(self, type):input In…Resistor Ohm Value Estimation Challenge
需要将误差降低到1%以下
1、调整模型架构增加模型的复杂性例如增加卷积层或全连接层的数量增加神经元数量等
# 在 ResistorEstimator 类的 CNN 方法中进行修改
def CNN(self, type):input Input(shape(64, 64, 3), nameinput)h self.conv2d(input, 32, (3, 3), paddingTrue, activationrelu, id1)h self.conv2d(h, 64, (3, 3), paddingTrue, activationrelu, id2)# 添加更多卷积层...h GlobalAveragePooling2D()(h)h Dense(256, activationrelu, namedense_1)(h)if type cls:output Dense(14, activationsoftmax, nameoutput)elif type reg:output Dense(1, activationlinear, nameoutput)return Model(inputsinput, outputsoutput)2、学习率调整
model.cnn.compile(optimizerAdam(learning_rate0.0001), losssparse_categorical_crossentropy, metrics[tf.keras.metrics.SparseCategoricalAccuracy()])3、数据增强调参
generator ImageDataGenerator(rotation_range45,width_shift_range0.1,height_shift_range0.1,zoom_range[0.9, 1.1],horizontal_flipTrue,vertical_flipFalse,fill_modenearest)4、增加训练时长增加epochs的值
history model.cnn.fit(train_ds, epochs200, callbacks[tb_cb], validation_datavalid_ds)目前还在苦逼调参中。。