Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hyperparameter recommendation based on experiments #6405

Merged
merged 4 commits into from
Apr 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,31 @@ def recommend_hyperparameters(df, model=None):

# every token is around 4 chars + 100 for extra capacity
max_seq_length = max_char_length // 4 + 100

if len(df) <= 100:
encoder_hidden_size = 1024
elif len(df) <= 1000:
encoder_hidden_size = 2048
else:
encoder_hidden_size = 4096

if len(df) <= 100:
lr = 5e-3
elif len(df) <= 1000:
lr = 1e-3
elif len(df) <= 10000:
lr = 5e-4
else:
lr = 1e-4

return {
'batch_size': bs,
'max_batch_size': max_bs,
'num_virtual_tokens': 10,
'lr': 0.0001,
'epochs': 25,
'lr': lr,
'epochs': 10,
'max_seq_length': max_seq_length,
'encoder_hidden_size': encoder_hidden_size,
}


Expand Down