Skip to content

Commit

Permalink
GA minor fixes (#244)
Browse files Browse the repository at this point in the history
* fix docstring nested FitGenetic.run

* fix lr + balance fraction num_neurons GA
  • Loading branch information
VicTrqt authored Nov 13, 2024
1 parent 53a9a6b commit 7ee7d8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion modnet/hyper_opt/fit_genetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def __init__(
self.xscale_before_impute = True
self.lr_list = [0.1, 0.01, 0.005, 0.001]
self.batch_size_list = [32, 64, 128, 256]
self.fraction_list = [1, 0.75, 0.5, 0.25]
self.fraction_list = [1, 1, 0.75, 0.5, 0.25]
# add 1 to balance the chance of having an architecture with the same num_neurons on each layer

if fit_params:
self.__dict__.update(fit_params)
Expand Down
4 changes: 2 additions & 2 deletions modnet/models/ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def _validate_ensemble_model(

model.fit(
train_data,
learning_rate=lr,
lr=lr,
epochs=epochs,
batch_size=batch_size,
loss=loss,
Expand All @@ -522,7 +522,7 @@ def _validate_ensemble_model(
val_data=val_data,
)

learning_curves = [m.history["val_loss"] for m in model.model]
learning_curves = [m.history["val_loss"] for m in model.models]

val_loss = model.evaluate(val_data)

Expand Down

0 comments on commit 7ee7d8b

Please sign in to comment.