Closed maxfilippov closed 3 years ago
Also added save & load methods to the ESN class itself
short explanation to the example switch_est_online_example.cpp
There we load the model previously trained using switch_est_save_example.cpp or switch_ext_save_stl_example.cpp
Then we load training_ds_2_fragm.csv input file of the following format
timestamp, r, g, b, label
and iterate through samples read from fields r, g, b.
We pass each triplet to model.encode and if the response is not empty, we concatenate the pair information to the overall output. For more readable output, we save also absolute index and number of total pairs in the currently returned output. This happens each 150th call if there is at least one switch in the scanned piece of 150 triplets. Please note that the output describes 150 inputs passed BEFORE last 150 inputs, so average delay is 150 + 150/2.
Finally we output pairs to the console.
At the end of the example another loop for online estimator calls is added, but the method .encode_raw used there returns raw switch values instead of pairs, so we can simply save them to .csv and plot using the script i've uploaded above. This addition is aimed only for this plot output and may be disabled.
now closing for updated "semi-online" version at https://github.com/panda-official/metric/pull/283 The new API is different!
Added 1st version of ESN-based trainable switch detector class for 3-dimensional timeseries. Allows (semi-)online estimation at every 150th input.