Skip to content

Nonlinear Scenarios in Difficulty Mode¤

apebench.scenarios.difficulty.Burgers ¤

Bases: Convection

Source code in apebench/scenarios/difficulty/_convection.py
68
69
70
71
72
73
74
75
76
77
class Burgers(Convection):
    convection_delta: float = -1.5  # Overwrite
    diffusion_gamma: float = 1.5

    def __post_init__(self):
        self.gammas = (0.0, 0.0, self.diffusion_gamma, 0.0, 0.0)
        super().__post_init__()

    def get_scenario_name(self) -> str:
        return f"{self.num_spatial_dims}d_diff_burgers"
convection_delta class-attribute instance-attribute ¤
convection_delta: float = -1.5
diffusion_gamma class-attribute instance-attribute ¤
diffusion_gamma: float = 1.5
__post_init__ ¤
__post_init__()
Source code in apebench/scenarios/difficulty/_convection.py
72
73
74
def __post_init__(self):
    self.gammas = (0.0, 0.0, self.diffusion_gamma, 0.0, 0.0)
    super().__post_init__()
get_scenario_name ¤
get_scenario_name() -> str
Source code in apebench/scenarios/difficulty/_convection.py
76
77
def get_scenario_name(self) -> str:
    return f"{self.num_spatial_dims}d_diff_burgers"

apebench.scenarios.difficulty.BurgersSingleChannel ¤

Bases: Nonlinear

Source code in apebench/scenarios/difficulty/_nonlinear.py
68
69
70
71
72
73
74
75
76
77
78
79
class BurgersSingleChannel(Nonlinear):
    convection_sc_delta: float = -1.5
    diffusion_gamma: float = 1.5

    def __post_init__(self):
        self.gammas = (0.0, 0.0, self.diffusion_gamma, 0.0, 0.0)
        self.deltas = (0.0, self.convection_sc_delta, 0.0)

        super().__post_init__()

    def get_scenario_name(self) -> str:
        return f"{self.num_spatial_dims}d_diff_burgers_sc"
convection_sc_delta class-attribute instance-attribute ¤
convection_sc_delta: float = -1.5
diffusion_gamma class-attribute instance-attribute ¤
diffusion_gamma: float = 1.5
__post_init__ ¤
__post_init__()
Source code in apebench/scenarios/difficulty/_nonlinear.py
72
73
74
75
76
def __post_init__(self):
    self.gammas = (0.0, 0.0, self.diffusion_gamma, 0.0, 0.0)
    self.deltas = (0.0, self.convection_sc_delta, 0.0)

    super().__post_init__()
get_scenario_name ¤
get_scenario_name() -> str
Source code in apebench/scenarios/difficulty/_nonlinear.py
78
79
def get_scenario_name(self) -> str:
    return f"{self.num_spatial_dims}d_diff_burgers_sc"

apebench.scenarios.difficulty.KortewegDeVries ¤

Bases: Nonlinear

Source code in apebench/scenarios/difficulty/_nonlinear.py
82
83
84
85
86
87
88
89
90
91
92
93
94
class KortewegDeVries(Nonlinear):
    convection_sc_delta: float = -2.0
    dispersion_gamma: float = -14.0
    hyp_diffusion_gamma: float = -9.0

    def __post_init__(self):
        self.gammas = (0.0, 0.0, 0.0, self.dispersion_gamma, self.hyp_diffusion_gamma)
        self.deltas = (0.0, self.convection_sc_delta, 0.0)

        super().__post_init__()

    def get_scenario_name(self) -> str:
        return f"{self.num_spatial_dims}d_diff_kdv"
convection_sc_delta class-attribute instance-attribute ¤
convection_sc_delta: float = -2.0
dispersion_gamma class-attribute instance-attribute ¤
dispersion_gamma: float = -14.0
hyp_diffusion_gamma class-attribute instance-attribute ¤
hyp_diffusion_gamma: float = -9.0
__post_init__ ¤
__post_init__()
Source code in apebench/scenarios/difficulty/_nonlinear.py
87
88
89
90
91
def __post_init__(self):
    self.gammas = (0.0, 0.0, 0.0, self.dispersion_gamma, self.hyp_diffusion_gamma)
    self.deltas = (0.0, self.convection_sc_delta, 0.0)

    super().__post_init__()
get_scenario_name ¤
get_scenario_name() -> str
Source code in apebench/scenarios/difficulty/_nonlinear.py
93
94
def get_scenario_name(self) -> str:
    return f"{self.num_spatial_dims}d_diff_kdv"

apebench.scenarios.difficulty.KuramotoSivashinsky ¤

Bases: Nonlinear

Source code in apebench/scenarios/difficulty/_nonlinear.py
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
class KuramotoSivashinsky(Nonlinear):
    gradient_norm_delta: float = -6.0
    diffusion_gamma: float = -1.2  # Negative diffusion! producing energy
    hyp_diffusion_gamma: float = -15.0

    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.gammas = (0.0, 0.0, self.diffusion_gamma, 0.0, self.hyp_diffusion_gamma)
        self.deltas = (0.0, 0.0, self.gradient_norm_delta)

        super().__post_init__()

    def get_scenario_name(self) -> str:
        return f"{self.num_spatial_dims}d_diff_ks"
gradient_norm_delta class-attribute instance-attribute ¤
gradient_norm_delta: float = -6.0
diffusion_gamma class-attribute instance-attribute ¤
diffusion_gamma: float = -1.2
hyp_diffusion_gamma class-attribute instance-attribute ¤
hyp_diffusion_gamma: float = -15.0
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/difficulty/_nonlinear.py
107
108
109
110
111
def __post_init__(self):
    self.gammas = (0.0, 0.0, self.diffusion_gamma, 0.0, self.hyp_diffusion_gamma)
    self.deltas = (0.0, 0.0, self.gradient_norm_delta)

    super().__post_init__()
get_scenario_name ¤
get_scenario_name() -> str
Source code in apebench/scenarios/difficulty/_nonlinear.py
113
114
def get_scenario_name(self) -> str:
    return f"{self.num_spatial_dims}d_diff_ks"

apebench.scenarios.difficulty.KuramotoSivashinskyConservative ¤

Bases: Convection

Source code in apebench/scenarios/difficulty/_convection.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
class KuramotoSivashinskyConservative(Convection):
    convection_delta: float = -1.0  # Overwrite
    diffusion_gamma: float = -2.0  # Negative diffusion; producing energy
    hyp_diffusion_gamma: float = -18.0

    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("KuramotoSivashinskyConservative is only defined for 1D")
        self.gammas = (0.0, 0.0, self.diffusion_gamma, 0.0, self.hyp_diffusion_gamma)
        super().__post_init__()

    def get_scenario_name(self) -> str:
        return f"{self.num_spatial_dims}d_diff_ks_cons"
convection_delta class-attribute instance-attribute ¤
convection_delta: float = -1.0
diffusion_gamma class-attribute instance-attribute ¤
diffusion_gamma: float = -2.0
hyp_diffusion_gamma class-attribute instance-attribute ¤
hyp_diffusion_gamma: float = -18.0
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/difficulty/_convection.py
90
91
92
93
94
def __post_init__(self):
    if self.num_spatial_dims != 1:
        raise ValueError("KuramotoSivashinskyConservative is only defined for 1D")
    self.gammas = (0.0, 0.0, self.diffusion_gamma, 0.0, self.hyp_diffusion_gamma)
    super().__post_init__()
get_scenario_name ¤
get_scenario_name() -> str
Source code in apebench/scenarios/difficulty/_convection.py
96
97
def get_scenario_name(self) -> str:
    return f"{self.num_spatial_dims}d_diff_ks_cons"