Skip to content

Commit a585887

Browse files
committed
fix
1 parent f1220ea commit a585887

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

deepxde/callbacks.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -578,18 +578,18 @@ def __init__(self, period=100, pde_points=True, bc_points=False):
578578
self.epochs_since_last_resample = 0
579579

580580
def on_train_begin(self):
581-
self.num_bcs_initial = self.model.problem.num_bcs
581+
self.num_bcs_initial = self.model.data.num_bcs
582582

583583
def on_epoch_end(self):
584584
self.epochs_since_last_resample += 1
585585
if self.epochs_since_last_resample < self.period:
586586
return
587587
self.epochs_since_last_resample = 0
588-
self.model.problem.resample_train_points(self.pde_points, self.bc_points)
588+
self.model.data.resample_train_points(self.pde_points, self.bc_points)
589589

590-
if not np.array_equal(self.num_bcs_initial, self.model.problem.num_bcs):
590+
if not np.array_equal(self.num_bcs_initial, self.model.data.num_bcs):
591591
print("Initial value of self.num_bcs:", self.num_bcs_initial)
592-
print("self.trainer.problem.num_bcs:", self.model.problem.num_bcs)
592+
print("self.model.data.num_bcs:", self.model.data.num_bcs)
593593
raise ValueError(
594-
"`num_bcs` changed! Please update the loss function by `trainer.compile`."
594+
"`num_bcs` changed! Please update the loss function by `model.compile`."
595595
)

0 commit comments

Comments
 (0)