Repository metrics
- Stars
- (7,162 stars)
- PR merge metrics
- (Avg merge 26d 10h) (86 merged PRs in 30d)
Description
Is your feature request related to a problem? Please describe. Related to the task of migrating estimators from sktime-dl to sktime. The main goal of doing so is to have all networks/models in a single package, following similar structure and quality.
Steps for Migration
Choose one of the Classifiers or Regressors from the list below, and create an issue for it. There are 2 key components to a DL Estimator, the Network (creates the actual code of neural network) and the Estimator (Is a layer of abstraction to make the user's life easier). Lets say I want to create CNNClassifier (steps are similar for any other DL Regressor or Classifier, whereever there are differences, I will mention them)
- Our first task would be to check if the network has already been implemented or not. Networks are often common for multiple estimators (for eg, CNNClassifier and CNNRegressor use the same CNNNetwork). So, I would check if a file named
cnn.pyexists insktime/sktime/networks. If it does, that means that the network has already been made, and you can skip to the step to create the classifier. - If the network has not been created, we need to create one. Create a file called
cnn.pyinsktime/sktime/networks. This file will contain ourCNNNetwork. You will have to migrate the network from sktime-dl to sktime. To do so, you will need to go tosktime-dl/networksand look for_cnn.py - Migrate this code from
sktime-dltosktime. An example of this migration is that the original code of_cnn.pyfrom sktime dl has been migrated ascnn.pyin sktime. The code, for most part, remains the same, with different documentation at most. There are a few cases where the migration is not as straightforward, and it would be described in the end. - Ensure all the tests pass for the Network you created! Run the pytest, and then run the
check_estimatortests as mentioned in the developer guide. Once all the tests pass, you have successfully migrated your Network. - Now, to create an estimator, lets create a new file called
cnn.pyatsktime/sktime/classification/deep_learning/. You will be migrating theCNNClassifierhere. You will have to migrate the network fromsktime-dltosktime. To do so, go tosktime-dl/classificationand look for_cnn.py. - Migrate this code from
sktime-dltosktime. An example of this migration is that the original code of_cnn.pyfromsktime-dlhas been migrated ascnn.pyinsktime. The code and core logic, for most part, remains the same. There are minor differences in_fitmethod you will need to take care of. For other cases where the migration is not as straightforward are described in the end. - Ensure all the tests pass for the Estimator you created! (the steps here are the same as step 4, but for Classifier/Regressor instead of Network)
Special Cases
Adding Soft Dependancy
- In cases where the particular network/estimator requires an additional dependency, (for example, CNTCNetwork requires
keras_self_attention), you have to add them as a soft dependancy - Firstly, go to
pyproject.toml, and check in theall_extraslist whether the dependency you want to add (lets saykeras_self_attention), already exists within it or not. IF it does, it means that it already is a soft dependancy, and you can skip the steps required to add it as a soft dep. - To add a dependency as soft dependency, follow the instructions mentioned in the dev guide. You mostly will have to add it in the
all_extraslist ofpyproject.toml. - Next, we need to go to the classes where we need to use the soft dep, and add a check for
_check_soft_dependencies. An example for how it is done is there inCNTCNetwork
DL Classifiers:
- CNN Classifier #2991 #2447
- CNTC Classifier #3171
- Encoder Classifier #3293
- FCN Classifier #3233
- InceptionTime Classifier #3003
- LSTMFCN Classifier #3714
- MACNN Classifier #3294
- MCDCNN Classifier #3295
- MCNN Classifier
- MLP Classifier #3232
- ResNet Classifier #3881
- TapNet Classifier #3372
- TLENet Classifier
- Twiesn Classifier