Skip to content

Commit

Permalink
BUG: Fix default for post_tfm_kwargs in config classes
Browse files Browse the repository at this point in the history
Default should be None, not an empty dict.
Setting it to an empty dict causes logic in core/eval
to instantiate a PostProcess transform
with majority_vote = False and min_segment_dur = None,
so that we end up applying post-processing that does nothing,
and the computed metric is the same as
without "post-processing".
This sets the default to None,
which fixes the issue.
  • Loading branch information
NickleDave committed Mar 3, 2023
1 parent 8e36d04 commit 1724d9e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/vak/config/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class EvalConfig:
post_tfm_kwargs = attr.ib(
validator=validators.optional(are_valid_post_tfm_kwargs),
converter=converters.optional(convert_post_tfm_kwargs),
default={}, # empty dict so we can pass into transform with **kwargs expansion
default=None,
)

# optional, data loader
Expand Down
2 changes: 1 addition & 1 deletion src/vak/config/learncurve.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ class LearncurveConfig(TrainConfig):
post_tfm_kwargs = attr.ib(
validator=validators.optional(are_valid_post_tfm_kwargs),
converter=converters.optional(convert_post_tfm_kwargs),
default={}, # empty dict so we can pass into transform with **kwargs expansion
default=None,
)

0 comments on commit 1724d9e

Please sign in to comment.