Skip to content

Commit

Permalink
make use of verbose setting in Experiment (#564)
Browse files Browse the repository at this point in the history
  • Loading branch information
tqtg committed Dec 11, 2023
1 parent af62a20 commit fec8886
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cornac/experiment/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ class Experiment:
show_validation: bool, optional, default: True
Whether to show the results on validation set (if exists).
verbose: bool, optional, default: False
Output running log/progress during model training and evaluation.
If verbose is True, it will overwrite verbosity setting of evaluation method and models.
save_dir: str, optional, default: None
Path to a directory for storing trained models and logs. If None,
models will NOT be stored and logs will be saved in the current working directory.
Expand Down Expand Up @@ -127,6 +131,13 @@ def run(self):
"""Run the Cornac experiment"""
self._create_result()

# overwrite verbosity setting of evaluation method and models
# if Experiment verbose is True
if self.verbose:
self.eval_method.verbose = self.verbose
for model in self.models:
model.verbose = self.verbose

for model in self.models:
test_result, val_result = self.eval_method.evaluate(
model=model,
Expand Down

0 comments on commit fec8886

Please sign in to comment.