sktime icon indicating copy to clipboard operation
sktime copied to clipboard

[ENH] Migrated LSTMFCN Classifer from sktime-dl

Open AurumnPegasus opened this issue 1 year ago • 3 comments

Reference Issues/PRs

Fixes #3193

PR checklist

For all contributions
  • [x] The PR title starts with either [ENH], [MNT], [DOC], or [BUG] indicating whether the PR topic is related to enhancement, maintenance, documentation, or bug.
For new estimators
  • [ ] I've added the estimator to the online documentation.
  • [ ] I've updated the existing example notebooks or provided a new one to showcase how my estimator works.

AurumnPegasus avatar Aug 19 '22 09:08 AurumnPegasus

Hey @fkiraly , Wanted to confirm if the creation of modules directory here is in line with what you were recommending when we discussed this.

AurumnPegasus avatar Aug 27 '22 05:08 AurumnPegasus

Sorry I forgot to comment on this, The issue I am facing with this classifier is that authors in sktime-dl have created there on keras layer (LSTMAttention) for this in a separate file: layer_utils in sktime_dl

To migrate the same structure into sktime I was thinking to create a modules directory (and then add appropriate layers there) (I have done this in current PR)

Need clarification if I can approach with this (also there seem to be dependancy issues wrt it, so some help on that) or if there is a better and cleaner option

AurumnPegasus avatar Sep 05 '22 05:09 AurumnPegasus

can this not go in the network dir? Let's not proliferate subdirs of src root.

fkiraly avatar Sep 11 '22 21:09 fkiraly

Hey, Facing a soft dependancy issue in this, we need to import keras.layers in the file in this in the file (not within the class/function as is recommended) in the file attentionlstm.py Is there a possible workaround for it?

AurumnPegasus avatar Oct 12 '22 13:10 AurumnPegasus

stick the import inside the function

fkiraly avatar Oct 12 '22 19:10 fkiraly

@fkiraly it cant, since those imports are essentially base classes from which our defined classes AttentionLSTM and AttentionLSTMCell are inheriting

AurumnPegasus avatar Oct 14 '22 10:10 AurumnPegasus

@fkiraly From what I understand, the idea behind Network classes was such that any keras network would be wrapped around it, yes, but in a way which would allow us to directly use the particular network for the estimators (like CNNNetwork can be easily used within CNNClassifier just by calling an object of it) In this case, the AttentionLSTM network is not meant to be used in a way where we directly use it within the estimator, just that its a network which is used within another network

A possible solution could be that we stick the functions _getAttentionLSTMCell and _getAttentionLSTM (basically all the functions in the file networks/attentionlstm.py) within the LSTMFCNNetwork, which would make the network class a bit crowded, but would still preserve the architectural consistency.

AurumnPegasus avatar Nov 07 '22 05:11 AurumnPegasus