Skip to content

Nonlinear Scenarios in normalized Mode¤

apebench.scenarios.normalized.Burgers ¤

Bases: Convection

Source code in apebench/scenarios/normalized/_convection.py
64
65
66
67
68
69
70
71
72
73
class Burgers(Convection):
    convection_beta: float = -1.25e-2  # Overwrite
    diffusion_alpha: float = 3.0e-5

    def __post_init__(self):
        self.alphas = (0.0, 0.0, self.diffusion_alpha, 0.0, 0.0)
        super().__post_init__()

    def get_scenario_name(self) -> str:
        return f"{self.num_spatial_dims}d_norm_burgers"
convection_beta class-attribute instance-attribute ¤
convection_beta: float = -0.0125
diffusion_alpha class-attribute instance-attribute ¤
diffusion_alpha: float = 3e-05
__post_init__ ¤
__post_init__()
Source code in apebench/scenarios/normalized/_convection.py
68
69
70
def __post_init__(self):
    self.alphas = (0.0, 0.0, self.diffusion_alpha, 0.0, 0.0)
    super().__post_init__()
get_scenario_name ¤
get_scenario_name() -> str
Source code in apebench/scenarios/normalized/_convection.py
72
73
def get_scenario_name(self) -> str:
    return f"{self.num_spatial_dims}d_norm_burgers"

apebench.scenarios.normalized.BurgersSingleChannel ¤

Bases: Nonlinear

Source code in apebench/scenarios/normalized/_nonlinear.py
62
63
64
65
66
67
68
69
70
71
72
73
class BurgersSingleChannel(Nonlinear):
    convection_sc_beta: float = -0.0125
    diffusion_alpha: float = 0.00003

    def __post_init__(self):
        self.alphas = (0.0, 0.0, self.diffusion_alpha, 0.0, 0.0)
        self.betas = (0.0, self.convection_sc_beta, 0.0)

        super().__post_init__()

    def get_scenario_name(self) -> str:
        return f"{self.num_spatial_dims}d_norm_burgers_sc"
convection_sc_beta class-attribute instance-attribute ¤
convection_sc_beta: float = -0.0125
diffusion_alpha class-attribute instance-attribute ¤
diffusion_alpha: float = 3e-05
__post_init__ ¤
__post_init__()
Source code in apebench/scenarios/normalized/_nonlinear.py
66
67
68
69
70
def __post_init__(self):
    self.alphas = (0.0, 0.0, self.diffusion_alpha, 0.0, 0.0)
    self.betas = (0.0, self.convection_sc_beta, 0.0)

    super().__post_init__()
get_scenario_name ¤
get_scenario_name() -> str
Source code in apebench/scenarios/normalized/_nonlinear.py
72
73
def get_scenario_name(self) -> str:
    return f"{self.num_spatial_dims}d_norm_burgers_sc"

apebench.scenarios.normalized.KortewegDeVries ¤

Bases: Nonlinear

Source code in apebench/scenarios/normalized/_nonlinear.py
76
77
78
79
80
81
82
83
84
85
86
87
88
class KortewegDeVries(Nonlinear):
    convection_sc_beta: float = -0.0125
    dispersion_alpha: float = -8.5e-7
    hyp_diffusion_alpha: float = -2e-9

    def __post_init__(self):
        self.alphas = (0.0, 0.0, 0.0, self.dispersion_alpha, self.hyp_diffusion_alpha)
        self.betas = (0.0, self.convection_sc_beta, 0.0)

        super().__post_init__()

    def get_scenario_name(self) -> str:
        return f"{self.num_spatial_dims}d_norm_kdv"
convection_sc_beta class-attribute instance-attribute ¤
convection_sc_beta: float = -0.0125
dispersion_alpha class-attribute instance-attribute ¤
dispersion_alpha: float = -8.5e-07
hyp_diffusion_alpha class-attribute instance-attribute ¤
hyp_diffusion_alpha: float = -2e-09
__post_init__ ¤
__post_init__()
Source code in apebench/scenarios/normalized/_nonlinear.py
81
82
83
84
85
def __post_init__(self):
    self.alphas = (0.0, 0.0, 0.0, self.dispersion_alpha, self.hyp_diffusion_alpha)
    self.betas = (0.0, self.convection_sc_beta, 0.0)

    super().__post_init__()
get_scenario_name ¤
get_scenario_name() -> str
Source code in apebench/scenarios/normalized/_nonlinear.py
87
88
def get_scenario_name(self) -> str:
    return f"{self.num_spatial_dims}d_norm_kdv"

apebench.scenarios.normalized.KuramotoSivashinsky ¤

Bases: Nonlinear

Source code in apebench/scenarios/normalized/_nonlinear.py
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
class KuramotoSivashinsky(Nonlinear):
    gradient_norm_beta: float = -0.00025
    diffusion_alpha: float = -0.000025
    hyp_diffusion_alpha: float = -3.0e-9

    num_warmup_steps: int = 500  # Overwrite
    vlim: tuple[float, float] = (-6.5, 6.5)  # Overwrite

    report_metrics: str = "mean_nRMSE,mean_correlation"  # Overwrite

    def __post_init__(self):
        self.alphas = (0.0, 0.0, self.diffusion_alpha, 0.0, self.hyp_diffusion_alpha)
        self.betas = (0.0, 0.0, self.gradient_norm_beta)

        super().__post_init__()

    def get_scenario_name(self) -> str:
        return f"{self.num_spatial_dims}d_norm_ks"
gradient_norm_beta class-attribute instance-attribute ¤
gradient_norm_beta: float = -0.00025
diffusion_alpha class-attribute instance-attribute ¤
diffusion_alpha: float = -2.5e-05
hyp_diffusion_alpha class-attribute instance-attribute ¤
hyp_diffusion_alpha: float = -3e-09
num_warmup_steps class-attribute instance-attribute ¤
num_warmup_steps: int = 500
vlim class-attribute instance-attribute ¤
vlim: tuple[float, float] = (-6.5, 6.5)
report_metrics class-attribute instance-attribute ¤
report_metrics: str = 'mean_nRMSE,mean_correlation'
__post_init__ ¤
__post_init__()
Source code in apebench/scenarios/normalized/_nonlinear.py
101
102
103
104
105
def __post_init__(self):
    self.alphas = (0.0, 0.0, self.diffusion_alpha, 0.0, self.hyp_diffusion_alpha)
    self.betas = (0.0, 0.0, self.gradient_norm_beta)

    super().__post_init__()
get_scenario_name ¤
get_scenario_name() -> str
Source code in apebench/scenarios/normalized/_nonlinear.py
107
108
def get_scenario_name(self) -> str:
    return f"{self.num_spatial_dims}d_norm_ks"

apebench.scenarios.normalized.KuramotoSivashinskyConservative ¤

Bases: Convection

Source code in apebench/scenarios/normalized/_convection.py
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
class KuramotoSivashinskyConservative(Convection):
    convection_delta: float = -6.0e-3
    diffusion_alpha: float = -4.0e-5
    hyp_diffusion_alpha: float = -3.0e-8

    num_warmup_steps: int = 500  # Overwrite
    vlim: tuple[float, float] = (-2.5, 2.5)  # Overwrite

    report_metrics: str = "mean_nRMSE,mean_correlation"  # Overwrite

    def __post_init__(self):
        if self.num_spatial_dims != 1:
            raise ValueError(
                "Conservative Kuramoto-Sivashinsky is only defined for 1 spatial dimension. Check out the non-conservative version for 2d."
            )
        self.alphas = (0.0, 0.0, self.diffusion_alpha, 0.0, self.hyp_diffusion_alpha)
        super().__post_init__()

    def get_scenario_name(self) -> str:
        return f"{self.num_spatial_dims}d_norm_ks_cons"
convection_delta class-attribute instance-attribute ¤
convection_delta: float = -0.006
num_warmup_steps class-attribute instance-attribute ¤
num_warmup_steps: int = 500
vlim class-attribute instance-attribute ¤
vlim: tuple[float, float] = (-2.5, 2.5)
report_metrics class-attribute instance-attribute ¤
report_metrics: str = 'mean_nRMSE,mean_correlation'
__post_init__ ¤
__post_init__()
Source code in apebench/scenarios/normalized/_convection.py
86
87
88
89
90
91
92
def __post_init__(self):
    if self.num_spatial_dims != 1:
        raise ValueError(
            "Conservative Kuramoto-Sivashinsky is only defined for 1 spatial dimension. Check out the non-conservative version for 2d."
        )
    self.alphas = (0.0, 0.0, self.diffusion_alpha, 0.0, self.hyp_diffusion_alpha)
    super().__post_init__()
get_scenario_name ¤
get_scenario_name() -> str
Source code in apebench/scenarios/normalized/_convection.py
94
95
def get_scenario_name(self) -> str:
    return f"{self.num_spatial_dims}d_norm_ks_cons"