Skip to content

Commit

Permalink
changed rounding of val and test from int convertion to math.ceil (#657)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristofferEdlund committed Sep 4, 2023
1 parent 1d392cf commit 88f277c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions darwin/dataset/split_manager.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import math
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, Iterable, List, Optional, Set, Tuple
Expand Down Expand Up @@ -140,8 +141,8 @@ def split_dataset(

# Compute sizes of each dataset partition
dataset_size: int = len(annotation_files)
val_size: int = int(val_percentage * dataset_size)
test_size: int = int(test_percentage * dataset_size)
val_size: int = math.ceil(val_percentage * dataset_size)
test_size: int = math.ceil(test_percentage * dataset_size)
train_size: int = dataset_size - val_size - test_size
split_id = f"{train_size}_{val_size}_{test_size}"

Expand Down

0 comments on commit 88f277c

Please sign in to comment.