Skip to content

Commit f155452

Browse files
fix doc
1 parent 20309ca commit f155452

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

ppsci/loss/integral.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class IntegralLoss(base.Loss):
3636
$M$ is the number of samples in monte carlo integration.
3737
3838
Args:
39-
reduction (str, optional): Reduction method. Defaults to "mean".
39+
reduction (Literal["mean", "sum"], optional): Reduction method. Defaults to "mean".
4040
weight (Optional[Union[float, Dict[str, float]]]): Weight for loss. Defaults to None.
4141
4242
Examples:

ppsci/loss/l1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class L1Loss(base.Loss):
3434
$$
3535
3636
Args:
37-
reduction (str, optional): Reduction method. Defaults to "mean".
37+
reduction (Literal["mean", "sum"], optional): Reduction method. Defaults to "mean".
3838
weight (Optional[Union[float, Dict[str, float]]]): Weight for loss. Defaults to None.
3939
4040
Examples:
@@ -85,7 +85,7 @@ class PeriodicL1Loss(base.Loss):
8585
"""Class for periodic l1 loss.
8686
8787
Args:
88-
reduction (str, optional): Reduction method. Defaults to "mean".
88+
reduction (Literal["mean", "sum"], optional): Reduction method. Defaults to "mean".
8989
"""
9090

9191
def __init__(

ppsci/loss/l2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ class L2RelLoss(base.Loss):
109109
$$
110110
L =
111111
\begin{cases}
112-
\dfrac{1}{N}\sum\limits_{i=1}^{N}{\dfrac{\Vert \bm{X_i}-\bm{Y_i}\Vert_2}{\Vert \bm{Y_i}\Vert_2}}, & \text{if reduction='mean'} \\
113-
\sum\limits_{i=1}^{N}{\dfrac{\Vert \bm{X_i}-\bm{Y_i}\Vert_2}{\Vert \bm{Y_i}\Vert_2}}, & \text{if reduction='sum'}
112+
\dfrac{1}{N}\sum\limits_{i=1}^{N}{\dfrac{\Vert \mathbf{X_i}-\mathbf{Y_i}\Vert_2}{\Vert \mathbf{Y_i}\Vert_2}}, & \text{if reduction='mean'} \\
113+
\sum\limits_{i=1}^{N}{\dfrac{\Vert \mathbf{X_i}-\mathbf{Y_i}\Vert_2}{\Vert \mathbf{Y_i}\Vert_2}}, & \text{if reduction='sum'}
114114
\end{cases}
115115
$$
116116

ppsci/loss/mse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class MSELoss(base.Loss):
3535
$$
3636
3737
Args:
38-
reduction (str, optional): Reduction method. Defaults to "mean".
38+
reduction (Literal["mean", "sum"], optional): Reduction method. Defaults to "mean".
3939
weight (Optional[Union[float, Dict[str, float]]]): Weight for loss. Defaults to None.
4040
4141
Examples:
@@ -130,7 +130,7 @@ class PeriodicMSELoss(base.Loss):
130130
"""Class for periodic mean squared error loss.
131131
132132
Args:
133-
reduction (str, optional): Reduction method. Defaults to "mean".
133+
reduction (Literal["mean", "sum"], optional): Reduction method. Defaults to "mean".
134134
weight (Optional[Union[float, Dict[str, float]]]): Weight for loss. Defaults to None.
135135
"""
136136

ppsci/visualize/visualizer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ class Visualizer3D(base.Visualizer):
292292
output_expr (Dict[str, Callable]): Output expression.
293293
batch_size (int, optional): Batch size of data when computing result in visu.py. Defaults to 64.
294294
label_dict (Dict[str, np.ndarray]): Label dict.
295-
transforms (Optional[Dict[str, ]]): Transformer dict.
296295
time_list (Optional[Tuple[float, ...]]): Time list.
297296
num_timestamps (int, optional): Number of timestamps.
298297
prefix (str, optional): Prefix for output file.

0 commit comments

Comments
 (0)