Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
co63oc committed Nov 14, 2023
1 parent 4dbbc28 commit 905967e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/zh/examples/nowcastnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ examples/nowcastnet/conf/nowcastnet.yaml:35:53

## 4 模型评估可视化

完成上述设置之后,只需要将上述实例化的对象按顺序传递给 `ppsci.solver.Solver`
完成上述设置之后,将上述实例化的对象按顺序传递给 `ppsci.solver.Solver`

``` py linenums="57" title="examples/nowcastnet/nowcastnet.py"
--8<--
Expand Down
Binary file modified docs/zh/examples/nowcastnet/pd.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 2 additions & 8 deletions ppsci/arch/nowcastnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class NowcastNet(base.Arch):
image_width (int, optional): Image width. Defaults to 512.
image_ch (int, optional): Image channel. Defaults to 2.
ngf (int, optional): Noise Projector input length. Defaults to 32.
num_timestamps (int, optional): Number of timestamp. Defaults to 1.
Examples:
>>> import ppsci
>>> model = ppsci.arch.NowcastNet(("input", ), ("output", ))
Expand All @@ -34,7 +33,6 @@ def __init__(
image_width: int = 512,
image_ch: int = 2,
ngf: int = 32,
num_timestamps: int = 1,
):
super().__init__()
self.input_keys = input_keys
Expand All @@ -46,7 +44,6 @@ def __init__(
self.image_width = image_width
self.image_ch = image_ch
self.ngf = ngf
self.num_timestamps = num_timestamps

configs = collections.namedtuple(
"Object", ["ngf", "evo_ic", "gen_oc", "ic_feature"]
Expand Down Expand Up @@ -76,11 +73,8 @@ def forward(self, x):
x_tensor = self.concat_to_tensor(x, self.input_keys)

y = []
input = x_tensor
for _ in range(self.num_timestamps):
out = self.forward_tensor(input)
y.append(out)
input = out
out = self.forward_tensor(x_tensor)
y.append(out)
y = self.split_to_dict(y, self.output_keys)

if self._output_transform is not None:
Expand Down
3 changes: 2 additions & 1 deletion ppsci/visualize/radar.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def save(self, path, data_dict):
if not os.path.exists(path):
os.makedirs(path)
test_ims = self.input_dict[list(self.input_dict.keys())[0]]
img_gen = data_dict[list(data_dict.keys())[0]]
# keys: {"input", "output"}
img_gen = data_dict[list(data_dict.keys())[1]]
vis_info = {"vmin": 1, "vmax": 40}
if self.case_type == "normal":
test_ims_plot = test_ims[0][
Expand Down

0 comments on commit 905967e

Please sign in to comment.