Artifacts And Results
Training, distillation, import, and evaluation runs write tracked outputs under
results/. Each run stores artifacts, configs, logs, and performance files.
Result Layout
Each run follows this structure:
Run names contain the framework, model, dataset, timestamp, and experiment id.
The current layout no longer creates nested result directories for individual
backbones such as bprmf/, lgcn/, or nmf/; model names are encoded in the
run and artifact filenames instead.
Artifact Types
.teacher trained or imported teacher
.student plain student baseline
.distilled_student distilled student model
Checkpointing
STUDENT_CHECKPOINT_FORMAT = 'recdistill.student.v1'
module-attribute
config_hash(config: dict[str, Any] | None) -> str | None
current_git_commit(repo_root: Path | None = None) -> str | None
Source code in recdistill/checkpointing.py
enrich_student_checkpoint_payload(payload: dict[str, Any]) -> dict[str, Any]
Source code in recdistill/checkpointing.py
save_student_checkpoint(path: str | Path, payload: dict[str, Any]) -> dict[str, Any]
Source code in recdistill/checkpointing.py
load_student_checkpoint(path: str | Path, map_location: str | torch.device = 'cpu') -> dict[str, Any]
Source code in recdistill/checkpointing.py
Runtime Paths
recdistill.paths resolves datasets, run directories, artifacts, histories, and
performance files for the flat run-based result layout.
| Helper | Purpose |
|---|---|
experiment_run_dir |
Builds results/<kind>/<run>/. |
experiment_artifact_path |
Builds paths under a run's artifacts/ directory. |
teacher_artifact_path |
Resolves a native teacher .teacher artifact. |
student_artifact_path |
Resolves a plain student .student artifact. |
distilled_student_artifact_path |
Resolves a .distilled_student artifact. |
resolve_teacher_checkpoint |
Finds an explicit or latest matching teacher checkpoint. |
resolve_student_checkpoint |
Resolves plain or distilled student checkpoints. |
REPO_ROOT = Path(__file__).resolve().parents[1]
module-attribute
PROJECT_PATH = str(REPO_ROOT)
module-attribute
DATA_ROOT = REPO_ROOT / 'data'
module-attribute
RESULTS_ROOT = REPO_ROOT / 'results'
module-attribute
CONFIG_ROOT = REPO_ROOT / 'config'
module-attribute
EXPERIMENTS_CONFIG_ROOT = CONFIG_ROOT / 'experiments'
module-attribute
PRESETS_ROOT = EXPERIMENTS_CONFIG_ROOT
module-attribute
TEACHER_EXT = '.teacher'
module-attribute
STUDENT_EXT = '.student'
module-attribute
DISTILLED_STUDENT_EXT = '.distilled_student'
module-attribute
CITEULIKE = 'citeulike'
module-attribute
BOOKCROSSING = 'bookcrossing'
module-attribute
AMAZONDM = 'amazon_dm'
module-attribute
AMAZONCD = 'amazon_cd'
module-attribute
_DATASET_FILENAME_BY_TYPE = {'raw': Path('data') / 'dataset.tsv', 'processed': Path('dataset.tsv'), 'train': Path('train.tsv'), 'val': Path('val.tsv'), 'test': Path('test.tsv')}
module-attribute
PathManager
Compatibility namespace for common runtime path labels.
The current result layout no longer groups artifacts by backbone-specific
nested directories. Artifact paths are resolved through run directories
under results/<kind>/<run>/artifacts/, while supported model names are
maintained by recdistill.registry.
Source code in recdistill/paths.py
DISTILLERS = ['de', 'rrd', 'unkd', 'htd', 'ftd', 'de_rrd', 'de_unkd', 'rrd_unkd', 'de_rrd_unkd']
class-attribute
instance-attribute
SUPPORTED_MODELS = sorted(_SUPPORTED_BACKBONES)
class-attribute
instance-attribute
DATASETS = ['amazon_cd', 'bookcrossing', 'citeulike']
class-attribute
instance-attribute
_create_directory(path: Path) -> None
new_experiment_id() -> str
timestamp_slug() -> str
experiment_kind_slug(kind: str) -> str
Source code in recdistill/paths.py
experiment_run_name(*, kind: str, experiment_id: str, framework: str | None = None, model: str | None = None, dataset: str | None = None, timestamp: str | None = None) -> str
Source code in recdistill/paths.py
experiment_run_dir(kind: str, experiment_id: str, *, framework: str | None = None, model: str | None = None, dataset: str | None = None, timestamp: str | None = None) -> Path
Source code in recdistill/paths.py
experiment_artifact_path(*, kind: str, experiment_id: str, filename: str, framework: str | None = None, model: str | None = None, dataset: str | None = None, timestamp: str | None = None) -> Path
Source code in recdistill/paths.py
experiment_artifact_filename(*, kind: str, experiment_id: str, framework: str, model: str, dataset: str, best: bool = False) -> str
Source code in recdistill/paths.py
experiment_kind_ext(kind: str) -> str
Source code in recdistill/paths.py
experiment_id_from_config_path(path: str | Path) -> str
Source code in recdistill/paths.py
normalize_experiment_id(value: Any = None, *, config_path: str | Path | None = None) -> str
Source code in recdistill/paths.py
_path_slug(value: Any) -> str
dataset_directory(dataset_name: str, create_if_not_exists: bool = True) -> str
Source code in recdistill/paths.py
dataset_filepath(dataset_name: str, type: str = 'raw', exists: bool = True) -> str
Source code in recdistill/paths.py
_relative_or_absolute(path: str | Path) -> Path
_framework_slug(framework: str | None, default: str = 'recbole') -> str
_dataset_slug(dataset: str) -> str
_model_label(model: str) -> str
Source code in recdistill/paths.py
teacher_artifact_path(*, framework: str | None, model: str, dataset: str, embedding_dim: int, strategy: str = 'fixed') -> Path
Source code in recdistill/paths.py
imported_teacher_artifact_path(*, framework: str | None, model: str, dataset: str, embedding_dim: int) -> Path
Source code in recdistill/paths.py
student_artifact_path(*, framework: str | None, model: str, dataset: str, embedding_dim: int, strategy: str = 'fixed') -> Path
Source code in recdistill/paths.py
distilled_student_artifact_path(*, distiller: str, teacher_framework: str | None, teacher_model: str, student_framework: str | None, student_model: str, dataset: str, embedding_dim: int, strategy: str = 'fixed') -> Path
Source code in recdistill/paths.py
resolve_teacher_checkpoint(*, dataset: str, teacher_model: str | None, teacher_embedding_dim: int | None, teacher_framework: str | None = None, teacher_path: str | Path | None = None) -> Path
Source code in recdistill/paths.py
_find_latest_teacher_artifact(*, framework: str | None, model: str, dataset: str, embedding_dim: int, prefer_best: bool = True) -> Path | None
Source code in recdistill/paths.py
resolve_student_checkpoint(*, dataset: str, distiller: str, teacher_model: str | None, student_backbone: str | None, student_embedding_dim: int, teacher_framework: str | None = None, student_framework: str | None = None, output_path: str | Path | None = None, strategy: str = 'fixed') -> Path
Source code in recdistill/paths.py
history_path(checkpoint_path: str | Path) -> Path
best_checkpoint_path(checkpoint_path: str | Path) -> Path
Source code in recdistill/paths.py
early_stop_checkpoint_path(checkpoint_path: str | Path) -> Path
Source code in recdistill/paths.py
recommendation_path(*, dataset: str, distiller: str, teacher_model: str | None, student_embedding_dim: int, student_backbone: str | None = None, filename: str | None = None) -> Path
Source code in recdistill/paths.py
performance_path(*, dataset: str, distiller: str, teacher_model: str | None, student_backbone: str | None = None, phase: str = 'fixed', filename: str = 'metrics.json') -> Path
Source code in recdistill/paths.py
teacher_weights_path(model: str, dataset: str, embedding_dim: int, phase: str = 'best', framework: str | None = None) -> str
Compatibility helper for legacy scripts, backed by the framework path module.
Source code in recdistill/paths.py
student_weights_path(distiller: str, teacher: str, dataset: str, embedding_dim: int, phase: str = 'fixed', student: str | None = None) -> str
Compatibility helper for exported distilled student payloads.