Skip to content

Fix bugs #429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/zh/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
4. `latest.pdstates`,该文件保存了 latest 对应 epoch 的所有评估指标以及 epoch 数。
5. `latest.pdscaler`(可选),在开启自动混合精度(AMP)功能时,该文件保存了 `GradScaler` 梯度缩放器内部的参数。

因此我们只需要在 `Solver` 时指定 `pretrained_model_path` 参数为 `latest。*` 的所在路径,即可自动载入上述的几个文件,并从 `latest` 中记录的 epoch 开始继续训练。
因此我们只需要在 `Solver` 时指定 `checkpoint_path` 参数为 `latest。*` 的所在路径,即可自动载入上述的几个文件,并从 `latest` 中记录的 epoch 开始继续训练。

``` py hl_lines="9"
import ppsci
Expand All @@ -25,7 +25,7 @@ import ppsci
solver = ppsci.solver.Solver(
...,
...,
pretrained_model_path="/path/to/latest"
checkpoint_path="/path/to/latest"
)
```

Expand Down
6 changes: 3 additions & 3 deletions ppsci/geometry/timedomain.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,9 @@ def random_initial_points(self, n, random="pseudo"):
return np.hstack((np.full([n, 1], t, dtype=paddle.get_default_dtype()), x))

def periodic_point(self, x, component):
t, _x = x[:, :1], x[:, 1:]
xp = self.geometry.periodic_point(_x, component)
return np.vstack((x, np.hstack(t, xp)))
xp = self.geometry.periodic_point(x, component)
txp = {"t": x["t"], **xp}
return txp

def sample_initial_interior(
self, n: int, random: str = "pseudo", criteria=None, evenly=False
Expand Down