sktime
sktime copied to clipboard
[ENH] Migrated LSTMFCN Classifer from sktime-dl
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.
Hey @fkiraly ,
Wanted to confirm if the creation of modules
directory here is in line with what you were recommending when we discussed this.
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
can this not go in the network
dir? Let's not proliferate subdirs of src root.
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?
stick the import inside the function
@fkiraly it cant, since those imports are essentially base classes from which our defined classes AttentionLSTM
and AttentionLSTMCell
are inheriting
@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.