lululxvi / deepxde

A library for scientific machine learning and physics-informed learning
https://deepxde.readthedocs.io
GNU Lesser General Public License v2.1
2.78k stars 758 forks source link

How to plot accuracy plots in deepxde? #1119

Open anshumansinha16 opened 1 year ago

anshumansinha16 commented 1 year ago

How to plot accuracy plots in deepxde, my current code only plots the test_metric, validation_loss and test_loss ; but I also wanted to look at the results of accuracy. How may I do so? I need to include some code for that right?

net = dde.maps.DeepONet(
    branch,
    trunk,
    "relu",
    "Glorot normal",
    use_bias=True,
    stacked=False,)

model = dde.Model(data, net)
model.compile("adam", lr=lr, metrics=[mean_squared_error])
checker = dde.callbacks.ModelCheckpoint(
    "/Users/dir/"+save_str+"model.ckpt", save_better_only=False, period=100
)

losshistory, train_state = model.train(epochs=epochs, callbacks=[checker]) 

dde.saveplot(losshistory, train_state, issave=True, isplot=True)
lululxvi commented 1 year ago

This is regression, not classification. There is no such thing as accuracy.