Skip to content

Commit

Permalink
feat: allow extra fields in config.hyperparameters (#434)
Browse files Browse the repository at this point in the history
The hyperparameters field in the config file was rigid (only permitting certain fields).
Now users can add more hyperparamters that are not necessarily declared in config.py's Hyperparameters class definition.
  • Loading branch information
GustavBaumgart committed Jun 15, 2023
1 parent 4249855 commit 77a0e09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/python/flame/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from enum import Enum

from pydantic import BaseModel as pydBaseModel
from pydantic import Field
from pydantic import Extra, Field


class FlameSchema(pydBaseModel):
Expand Down Expand Up @@ -125,7 +125,7 @@ class BaseModel(FlameSchema):
version: int = Field(default=0)


class Hyperparameters(FlameSchema):
class Hyperparameters(FlameSchema, extra=Extra.allow):
batch_size: t.Optional[int] = Field(alias="batchSize")
learning_rate: t.Optional[float] = Field(alias="learningRate")
weight_decay: t.Optional[float] = Field(alias="weightDecay")
Expand Down

0 comments on commit 77a0e09

Please sign in to comment.