tomasohara / mezcla

Upgrade to misc-utility: miscellaneous python utility scripts developed for various projects over the years,
GNU Lesser General Public License v3.0
3 stars 1 forks source link

Increase flexibility by handling hyperparameters at config level #114

Open shitlesh opened 1 week ago

shitlesh commented 1 week ago

Without a proper configuration for hyperparameters, users are forced to hardcode values or manually modify the script each time they need to adjust parameters for different environments or experiments.

Extend the config.py file to include additional hyperparameters for machine learning tasks, such as MAX_SEQ_LENGTH, BATCH_SIZE, LEARNING_RATE, and EPOCHS. These hyperparameters should be configurable through environment variables, providing both default values and the flexibility to override them dynamically.

Example Code:

Hyperparameters

MAX_SEQ_LENGTH = system.getenv_int( "MAX_SEQ_LENGTH", 128, description="Maximum sequence length for training")

BATCH_SIZE = system.getenv_int( "BATCH_SIZE", 32, description="Batch size for training")

LEARNING_RATE = system.getenv_float( "LEARNING_RATE", 3e-5, description="Learning rate for optimizer")

EPOCHS = system.getenv_int( "EPOCHS", 10, description="Number of epochs for training")

tomasohara commented 1 day ago

Thanks, I'm not sure which script you are talking about about. Note that those related to BERT, where meant as customizations to address specific limitations in the Google code they are based on (i.e., not meant to be general replacements).

In addition, the Tensorflow-based API they use is becoming obsolete, so I recommend a solution based on Hugging Face.