Skip to content

Commit

Permalink
cap score to 1 (#1383)
Browse files Browse the repository at this point in the history
Co-authored-by: Kartik Pradeepan <[email protected]>
  • Loading branch information
benlonnqvist and KartikP authored Nov 9, 2024
1 parent 5adf516 commit 846ffa6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions brainscore_vision/benchmarks/lonnqvist2024/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ def __call__(self, candidate: BrainModel, return_raw_responses: bool = False):
# Adjust score to ceiling
ceiling = self.ceiling
score = raw_score / ceiling
# ensure score <= 1.0
if score.values > 1:
score = Score(np.array(1.))
score.attrs['raw'] = raw_score
score.attrs['ceiling'] = ceiling
if return_raw_responses:
Expand Down
3 changes: 3 additions & 0 deletions brainscore_vision/benchmarks/malania2007/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ def __call__(self, candidate: BrainModel):
# Adjust score to ceiling
ceiling = self.ceiling
score = raw_score / ceiling
# ensure score <= 1.0
if score.values > 1:
score = Score(np.array(1.))
score.attrs['error'] = raw_score.error

score.attrs['raw'] = raw_score
Expand Down

0 comments on commit 846ffa6

Please sign in to comment.