From ad6399b27c3a0702abd24d45f889ca55497476c2 Mon Sep 17 00:00:00 2001 From: vl-dud <60846135+vl-dud@users.noreply.github.com> Date: Mon, 17 Jun 2024 18:42:43 +0300 Subject: [PATCH] PDEOperator supports resample_train_points (#1759) --- deepxde/data/pde_operator.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/deepxde/data/pde_operator.py b/deepxde/data/pde_operator.py index baef087ec..ce573274d 100644 --- a/deepxde/data/pde_operator.py +++ b/deepxde/data/pde_operator.py @@ -167,6 +167,12 @@ def bc_inputs(self, func_feats, func_vals): self.train_bc = (np.vstack(v), np.vstack(x), np.vstack(vx)) return self.train_bc + def resample_train_points(self, pde_points=True, bc_points=True): + """Resample the training points for the operator.""" + self.pde.resample_train_points(pde_points, bc_points) + self.train_x, self.train_y, self.train_aux_vars = None, None, None + self.train_next_batch() + class PDEOperatorCartesianProd(Data): """PDE solution operator with data in the format of Cartesian product.