Skip to content

Commit cfd6163

Browse files
committed
Codacy formatting
1 parent 5722ebb commit cfd6163

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

deepxde/model.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,12 @@ def compile(
109109
110110
- For backend JAX:
111111
112-
- `linear_schedule <https://optax.readthedocs.io/en/latest/api/optimizer_schedules.html#optax.schedules.linear_schedule>`_: ("linear", end_value, transition_steps)
113-
- `cosine_decay_schedule <https://optax.readthedocs.io/en/latest/api/optimizer_schedules.html#optax.schedules.cosine_decay_schedule>`_: ("cosine", decay_steps, alpha)
114-
- `exponential_decay <https://optax.readthedocs.io/en/latest/api/optimizer_schedules.html#optax.schedules.exponential_decay>`_: ("exponential", transition_steps, decay_rate)
112+
- `linear_schedule <https://optax.readthedocs.io/en/latest/api/optimizer_schedules.html#optax.schedules.linear_schedule>`_:
113+
("linear", end_value, transition_steps)
114+
- `cosine_decay_schedule <https://optax.readthedocs.io/en/latest/api/optimizer_schedules.html#optax.schedules.cosine_decay_schedule>`_:
115+
("cosine", decay_steps, alpha)
116+
- `exponential_decay <https://optax.readthedocs.io/en/latest/api/optimizer_schedules.html#optax.schedules.exponential_decay>`_:
117+
("exponential", transition_steps, decay_rate)
115118
116119
loss_weights: A list specifying scalar coefficients (Python floats) to
117120
weight the loss contributions. The loss value that will be minimized by

deepxde/optimizers/jax/optimizers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ def _get_learningrate(lr, decay):
3838
return lr
3939
if decay[0] == "linear":
4040
return optax.linear_schedule(lr, decay[1], decay[2])
41-
elif decay[0] == "cosine":
41+
if decay[0] == "cosine":
4242
return optax.cosine_decay_schedule(lr, decay[1], decay[2])
43-
elif decay[0] == "exponential":
43+
if decay[0] == "exponential":
4444
return optax.exponential_decay(lr, decay[1], decay[2])
4545

4646
raise NotImplementedError(

0 commit comments

Comments
 (0)