dianna-ai / dianna

Deep Insight And Neural Network Analysis
https://dianna.readthedocs.io
Apache License 2.0
48 stars 13 forks source link

Replace model runner function by preprocessing function #806

Open loostrum opened 5 months ago

loostrum commented 5 months ago

In a lot of the more recent tutorials a run_model function is defined, with reasoning such as

"A runner function is required since the model works with input in the order of [channels, timeseries], while LIME in DIANNA should receive input in the opposite order."

However, things like this is why we added the preprocess_function option. It's meant to be simpler than defining an entire model runner function. Should we replace the model runners by the preprocess_function where possible?

loostrum commented 5 months ago

Example of a transpose + data type change similar to how it's used in the FRB tutorial:

def preprocess(data):
    return np.transpose(data, (0, 2, 1)).astype(np.float32)