hyperdimensional-computing / torchhd

Torchhd is a Python library for Hyperdimensional Computing and Vector Symbolic Architectures
https://torchhd.readthedocs.io
MIT License
221 stars 23 forks source link

Add intRVFL to the models module #125

Closed denkle closed 1 year ago

denkle commented 1 year ago

Add intRVFL to the models module

denkle commented 1 year ago

Thanks for the refactoring, Mike! I like how the new code looks like. Functionality-wise, it is all good, I only added a few minor edits.

Few minor edits made:

  1. train_loader in “UCI_benchmark_intRVFL.py” is not needed anymore with the current code. [Fixed].
  2. In “UCI_benchmark_intRVFL.py”, added transform() to data when calling “fit_ridge_regression()” - was affecting performance a lot.
  3. In “models.py”, kappa is not mentioned as a part of description in “Args”. [Fixed]
  4. In “UCI_benchmark_intRVFL.py”, ridge regression was missing (not a big effect on results though) when calling “fit_ridge_regression()”. [Fixed]
denkle commented 1 year ago

Few additional considerations while going through the code:

  1. It could make sense to have alpha as an input to IntRVFLRidge() and then avoid calling it explicitly with “fit_ridge_regression()”.
  2. I would hide “one_hot_targets” under the hood in “fit_ridge_regression” as it is unclear what does it give to the user by explicitly seeing formation of one-hot encodings in “UCI_benchmark_intRVFL.py” but I see the extra hassle with sending in "num_classes".
  3. After refactoring, “fit_ridge_regression()” is a function within IntRVFLRidge() class. Before it was meant to be a separate function just because it is a primitive for a particular type of classifier (like centroids) so it does not have to stay exclusively within IntRVFLRidge(). But perhaps it is not so complicated so one could copy-paste this piece of code every time it is needed in some other place. All these considerations are not critical and perhaps not worth extra discussion so the final word about them is yours.
mikeheddes commented 1 year ago

Thanks for spotting my bugs!

denkle commented 1 year ago