Clarify empty extra-info logging
This commit is contained in:
@@ -32,6 +32,7 @@ from targets import CHECKUP_IDX, PAD_IDX
|
|||||||
from train_util import (
|
from train_util import (
|
||||||
configure_torch_for_training,
|
configure_torch_for_training,
|
||||||
create_unique_run_dir,
|
create_unique_run_dir,
|
||||||
|
format_extra_info_types,
|
||||||
load_extra_info_types_file,
|
load_extra_info_types_file,
|
||||||
resolve_device,
|
resolve_device,
|
||||||
save_checkpoint,
|
save_checkpoint,
|
||||||
@@ -340,7 +341,7 @@ def main() -> None:
|
|||||||
|
|
||||||
logger.info(f"Starting all-future training run: {run_name}")
|
logger.info(f"Starting all-future training run: {run_name}")
|
||||||
logger.info(f"Device: {device}")
|
logger.info(f"Device: {device}")
|
||||||
logger.info(f"extra_info_types: {args.extra_info_types or 'all'}")
|
logger.info(f"extra_info_types: {format_extra_info_types(args.extra_info_types)}")
|
||||||
|
|
||||||
logger.info("Loading all-future datasets...")
|
logger.info("Loading all-future datasets...")
|
||||||
train_dataset = AllFutureHealthDataset(
|
train_dataset = AllFutureHealthDataset(
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ from targets import CHECKUP_IDX, NO_EVENT_IDX, PAD_IDX
|
|||||||
from train_util import (
|
from train_util import (
|
||||||
configure_torch_for_training,
|
configure_torch_for_training,
|
||||||
create_unique_run_dir,
|
create_unique_run_dir,
|
||||||
|
format_extra_info_types,
|
||||||
load_extra_info_types_file,
|
load_extra_info_types_file,
|
||||||
resolve_device,
|
resolve_device,
|
||||||
save_checkpoint,
|
save_checkpoint,
|
||||||
@@ -526,7 +527,7 @@ def main() -> None:
|
|||||||
|
|
||||||
logger.info(f"Starting next-step training run: {run_name}")
|
logger.info(f"Starting next-step training run: {run_name}")
|
||||||
logger.info(f"Device: {device}")
|
logger.info(f"Device: {device}")
|
||||||
logger.info(f"extra_info_types: {args.extra_info_types or 'all'}")
|
logger.info(f"extra_info_types: {format_extra_info_types(args.extra_info_types)}")
|
||||||
logger.info(f"readout={args.readout_name}, target_mode={args.target_mode}")
|
logger.info(f"readout={args.readout_name}, target_mode={args.target_mode}")
|
||||||
|
|
||||||
dataset = HealthDataset(
|
dataset = HealthDataset(
|
||||||
|
|||||||
@@ -87,6 +87,15 @@ def load_extra_info_types_file(path: str) -> list[int]:
|
|||||||
raise ValueError(f"Invalid extra info type id in {path}") from exc
|
raise ValueError(f"Invalid extra info type id in {path}") from exc
|
||||||
|
|
||||||
|
|
||||||
|
def format_extra_info_types(extra_info_types: Iterable[int] | None) -> str:
|
||||||
|
if extra_info_types is None:
|
||||||
|
return "all"
|
||||||
|
values = [int(x) for x in extra_info_types]
|
||||||
|
if not values:
|
||||||
|
return "none"
|
||||||
|
return str(values)
|
||||||
|
|
||||||
|
|
||||||
def load_eid_file(path: str | Path) -> set[int]:
|
def load_eid_file(path: str | Path) -> set[int]:
|
||||||
file_path = Path(path)
|
file_path = Path(path)
|
||||||
if not file_path.is_file():
|
if not file_path.is_file():
|
||||||
|
|||||||
Reference in New Issue
Block a user