|
pulsatrix 1.1.0
|
Collects RelevanceDiff results over a dataset by input token: which tokens a fine-tune made the model rely on more, and which less. More...
#include <fine_tune_diff.hpp>
Public Member Functions | |
| void | add (const Tensor &token_ids, const RelevanceDiff &diff) |
Adds one batch: token_ids (N, L) and a diff whose relevance is (N, L). Each score is divided by its sample's tuned or base score, so samples weigh alike. | |
| std::vector< TokenShift > | top (int64_t n, bool decrease=false, int64_t min_count=1) const |
The n tokens with the largest mean increase (or, with decrease, the largest mean decrease), among those seen at least min_count times. | |
| std::vector< TokenShift > | all () const |
| Every token seen, by id. | |
Collects RelevanceDiff results over a dataset by input token: which tokens a fine-tune made the model rely on more, and which less.
| void pulsatrix::TokenRelevanceShift::add | ( | const Tensor & | token_ids, |
| const RelevanceDiff & | diff | ||
| ) |
Adds one batch: token_ids (N, L) and a diff whose relevance is (N, L). Each score is divided by its sample's tuned or base score, so samples weigh alike.
| std::invalid_argument | if the shapes differ. |
| std::vector< TokenShift > pulsatrix::TokenRelevanceShift::all | ( | ) | const |
Every token seen, by id.
| std::vector< TokenShift > pulsatrix::TokenRelevanceShift::top | ( | int64_t | n, |
| bool | decrease = false, |
||
| int64_t | min_count = 1 |
||
| ) | const |
The n tokens with the largest mean increase (or, with decrease, the largest mean decrease), among those seen at least min_count times.