Skip to content

Commit

Permalink
Backend paddle: support examples in directory 'function'
Browse files Browse the repository at this point in the history
  • Loading branch information
lijialin03 committed Nov 28, 2024
1 parent 8275aeb commit e13d2d7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions deepxde/data/mf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import numpy as np

from .data import Data
from ..backend import tf
from .. import backend as bkd
from .. import config
from ..utils import run_if_any_none, standardize


Expand Down Expand Up @@ -116,7 +117,7 @@ def losses_train(self, targets, outputs, loss_fn, inputs, model, aux=None):
return [loss_lo, loss_hi]

def losses_test(self, targets, outputs, loss_fn, inputs, model, aux=None):
return [0, loss_fn(targets[1], outputs[1])]
return [bkd.as_tensor(0, dtype=config.real(bkd.lib)), loss_fn(targets[1], outputs[1])]

@run_if_any_none("X_train", "y_train")
def train_next_batch(self, batch_size=None):
Expand Down
2 changes: 1 addition & 1 deletion examples/function/func_uncertainty.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Backend supported: tensorflow.compat.v1, tensorflow"""
"""Backend supported: tensorflow.compat.v1, tensorflow, paddle"""
import deepxde as dde
import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion examples/function/mf_dataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Backend supported: tensorflow.compat.v1"""
"""Backend supported: tensorflow.compat.v1, paddle"""
import deepxde as dde


Expand Down
2 changes: 1 addition & 1 deletion examples/function/mf_func.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Backend supported: tensorflow.compat.v1"""
"""Backend supported: tensorflow.compat.v1, paddle"""
import deepxde as dde
import numpy as np

Expand Down

0 comments on commit e13d2d7

Please sign in to comment.