Skip to content

Commit 305b188

Browse files
committed
feat: add perovskite solar cells model with hyperparameter optimization
1 parent 3dc91d3 commit 305b188

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/perovskite_solar_cells/psc_nn.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ def create_optimizer(model, optimizer_name, lr, train_cfg, data_size):
8787
epochs=train_cfg.epochs,
8888
iters_per_epoch=data_size // train_cfg.batch_size,
8989
learning_rate=lr,
90-
gamma=0.95,
91-
decay_steps=5,
92-
warmup_epoch=2,
93-
warmup_start_lr=1.0e-6,
90+
gamma=train_cfg.lr_scheduler.gamma,
91+
decay_steps=train_cfg.lr_scheduler.decay_steps,
92+
warmup_epoch=train_cfg.lr_scheduler.warmup_epoch,
93+
warmup_start_lr=train_cfg.lr_scheduler.warmup_start_lr,
9494
)()
9595

9696
if optimizer_name == "Adam":
@@ -309,7 +309,7 @@ def evaluate(cfg: DictConfig):
309309
r2 = r2_score(y_val.values, predictions)
310310
mape = mean_absolute_percentage_error(y_val.values, predictions)
311311

312-
print(f"Evaluation metrics:")
312+
print("Evaluation metrics:")
313313
print(f"RMSE: {rmse:.5f}")
314314
print(f"R2 Score: {r2:.5f}")
315315
print(f"MAPE: {mape:.5f}")

0 commit comments

Comments
 (0)