Skip to content

Commit

Permalink
Merge pull request #23 from microsoft/feat/downgrage-to-debug
Browse files Browse the repository at this point in the history
fs_mol/utils/test_utils.py
  • Loading branch information
megstanley authored Aug 27, 2021
2 parents 429c2be + 9e2411b commit 14f24c5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fs_mol/data/protonet.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def path_to_batches_pipeline(paths: List[RichPath], idx: int):
task_sample = task_sampler.sample(task, seed=idx + num_task_samples)
num_task_samples += 1
except Exception as e:
logger.warning(f"{task.name}: Sampling failed: {e}")
logger.debug(f"{task.name}: Sampling failed: {e}")
continue

yield task_sample_to_pn_task_sample(task_sample, batcher)
Expand Down
6 changes: 5 additions & 1 deletion fs_mol/maml_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
FSMolTaskSample,
StratifiedTaskSampler,
)
from fs_mol.data.fsmol_task_sampler import SamplingException
from fs_mol.data.maml import FSMolStubGraphDataset, TFGraphBatchIterable
from fs_mol.models.metalearning_graph_binary_classification import (
MetalearningGraphBinaryClassificationTask,
Expand Down Expand Up @@ -214,7 +215,10 @@ def metatrain_loop(
def read_and_sample_from_task(paths: List[RichPath], id: int) -> Iterable[FSMolTaskSample]:
for i, path in enumerate(paths):
task = FSMolTask.load_from_file(path)
yield task_sampler.sample(task, seed=id + i)
try:
yield task_sampler.sample(task, seed=id + i)
except SamplingException as e:
logger.debug(f"Sampling task failed:\n{str(e)}")

# A metatesting epoch is when given a pre-trained model, we iterate over all validation tasks,
# fine-tune the model to convergence and report back the results. The resulting metric
Expand Down
2 changes: 1 addition & 1 deletion fs_mol/utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def eval_model(
FoldTooSmallException,
ValueError,
) as e:
logger.warning(
logger.debug(
f"Failed to draw sample with {train_size} train points for {task.name}. Skipping."
)
logger.debug("Sampling error: " + str(e))
Expand Down

0 comments on commit 14f24c5

Please sign in to comment.