Skip to content

Complicated **kwargs handling in vector field trainer #1775

Closed

Description

@janfb

When I was running the mini benchmark for #1754 I noticed that there are multiple entries specifying keyword arguments for NPSE, e.g., via posterior_score_nn when constructing the vf builder function, or via NPSE trainer init directly. One way or another, arguments would be ignored.

Additionally, I was accidentally passing the builder via density_estimator instead of via vf_estimator to NPSE. There war no warning, my params just didn't have any effect.

The reason is that NPSE and FMPE forward configuration through a 4-level **kwargs chain:

NPSE → VectorFieldTrainer → _build_default_nn_fn → posterior_score_nn → build_vector_field_estimator → VEScoreEstimator

A typo like NPSE(prior, train_shedule="lognormal") is silently swallowed. The user would get default uniform schedules without any warning.

I will open a follow up PR that:

  • removes **kwargs from NPSE and FMPE and uses a small set of explicit kwargs like in the NPE trainers.
  • use config dataclass internally so that misspelled kwargs will be detected and an error be raised.

Activity

  1. added
    bug
    on Feb 20, 2026
  2. self-assigned this
    on Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions