我具有在keras中构建模型的功能,如下所示:
def build_model(lr = 0.0):
inp = Input(shape = (max_len,))
x = Embedding_layer
y = LSTM_layer(x)
y = Convolution_layer(y)
x = GlobalMaxPooling1D(y)
x = Dense(3, activation = "sigmoid")(x)
model = Model(inputs = inp, outputs = x)
model.compile(loss = "binary_crossentropy", optimizer = Adam(), metrics = ["accuracy"])
history = model.fit(X_train, Y_train, batch_size = 256, epochs = 3,
verbose = 1, callbacks = [ra_val, check_point, early_stop])
model = load_model(file_path)
return model
model = build_model(lr = 1e-3)
现在我想在训练阶段后绘制历史记录损失和准确性,但是模型没有历史记录选项。
如何绘制损耗和精度?