Skip to content

Commit

Permalink
Fix labels missing indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
psaegert committed Feb 9, 2025
1 parent a2479e4 commit c76b637
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/flash_ansr/compat/evaluation_nesymres.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def evaluate(
results_dict['n_support'].append([batch['x_tensors'].shape[1] // 2] * batch['x_tensors'].shape[0])

# Create the labels for the next token prediction task (i.e. shift the batch['input_ids'] by one position to the right)
labels = batch['labels'].clone()
labels = batch['labels'][0].clone()
labels_decoded = expression_space.tokenizer.decode(labels.tolist(), special_tokens='<num>')

# TODO: For different datasets, sort unused dimensions to the end
Expand Down
2 changes: 1 addition & 1 deletion src/flash_ansr/compat/evaluation_pysr.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def evaluate(
results_dict['n_support'].append([x_tensor.shape[1] // 2] * x_tensor.shape[0])

# Create the labels for the next token prediction task (i.e. shift the input_ids by one position to the right)
labels = batch['labels'].clone()
labels = batch['labels'][0].clone()
labels_decoded = expression_space.tokenizer.decode(batch['labels'].tolist(), special_tokens='<num>')

# TODO: For different datasets, sort unused dimensions to the end
Expand Down

0 comments on commit c76b637

Please sign in to comment.