sintel-dev / Orion

A machine learning library for detecting anomalies in signals.
https://sintel.dev/Orion/
MIT License
1.01k stars 158 forks source link

Customize hyper-parameters for pipelines #198

Open ZhuofanXie opened 3 years ago

ZhuofanXie commented 3 years ago

Description

In the tutorial notebook, it is recommended that "For experimentation purposes, you can reduce the number of epochs in the tadgan.json file such that you reduce the number of training iterations."

This operation is risky in the sense that tadgan.json is in some sense considered the default pipeline file. If the users forget to change it back (which is very likely if they are only doing an experimental run in their first trial), it might lead to undertraining in later runs. Also, this operation is inconvenient, especially when the users want to try a couple hyper-parameter(s) to find out the best fit for their data sets.

One solution might be to remind the users in the tutorial notebook that they can first load the json files as dictionaries, change the hyper-parameter(s) inside and then pass it into the Orion factory method.

Alternatively, like many other classes (e.g. sklearn models), we can give the users the option to pass in additional keyword arguments (or as dictionaries) to overwrite the ones in the json files. That is, creating objects in these ways:

orion = Orion(
    pipeline='tadgan.json', epochs=10
)

or

orion = Orion(
    pipeline='tadgan.json', kwargs={epochs : 10}
)
sarahmish commented 3 years ago

Thanks @ZhuofanXie for the suggestion!

Some ideas on how to proceed with this feature:

"hyperparameters": {
    "mapping": [
        "epochs": "keras.Sequential. LSTMTimeSeriesRegressor#1.epochs"
    ]
}