aai-institute / nnbench

A small framework for benchmarking machine learning models.
https://aai-institute.github.io/nnbench/
Apache License 2.0
10 stars 3 forks source link

Add `transform` slot to record IO types #140

Open nicholasjng opened 6 months ago

nicholasjng commented 6 months ago

Instead of this:

    record = runner.run(__name__, params=params)

    transform = MyTransform()
    trecord = transform.apply(record)
    f = FileIO()
    f.write(trecord, "record.json")

should come this:

    record = runner.run(__name__, params=params)
    f = FileIO()
    f.write(record, "record.json", *, transform=MyTransform())

Might also be useful to give a feature flag inverse=True designating whether to use an inverse transform or not. This imposes the view that serializing = forward, deserializing = inverse transform, but to me, that's the most natural way of thinking about it.

Bonus: Should the transform be keyword-only (leaning no), or the aforementioned inverse argument (leaning yes)?