-
Notifications
You must be signed in to change notification settings - Fork 3
cross_entropy calc #18
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
base: main
Are you sure you want to change the base?
Conversation
from reasoning_fine_tune.utils.seed import set_seed | ||
from reasoning_fine_tune.utils.validation import validate_mmlu_answer | ||
|
||
def estimate_dataset( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А мы бы не хотели попробовать параметризовать функцию для подсчета энтропии одного токена? Кажется, что если научить ее принимать compute_entropy_from_logits
снаружи, то можно избежать дубликации кода. Что скажешь?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ну и имена полей можно тогда тоже кастомные позволит задавать: field_ans
и прочее
return_dict=True | ||
) | ||
|
||
last_token_logits = outputs.logits[:, -1,:] # [batch_size, vocab_size] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А вот это прям хорошая находка! Надо нам и для подсчета single token entropy переехать на outputs.logits
А для фишки сделаешь разбивку? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add data splits and trainer_state
Cross-entropy calculation scripts and folder/dataset