-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
input shape issue with LSTM model #16
Comments
Hi, most of the existing AL strategies are designed for a 2D feature array, so you should extract a 2D feature matrix of your dataset for AL selection. E.g., the hidden state of the LSTM, or the output of the penultimate layer of a VGG. |
Okay, understood. |
I got the 2d feature matrix out of the hidden states etc.
The error is the following: |
Hi, sorry for the inconvenience. By the way, there may be other issues in your code If you want to use the Keras classifier, please see issue 2. Or just use another strategy which does not need a prediction model (e.g., QUIRE). |
Hi, I am still wondering about the strategy you proposed on how to fix the 3D issue. From what I understood up to now, the query strategies depend heavily on the otucome of the predict_proba method? If that is the case, the strategies should work with a 2d or 3d feature matrix, because they use the models' own predict_proba method? So in conclusion, if the model accepts a 3D input feature matrix, the query strategy method should do as well? Pls correct me if I am wrong, but I dont see the need for this 2D constraint. |
Hi, alexv1247! Actually there are two different settings to do the sample selection in active learning. One is purely relying on unsupervised approach to select samples based on the data structure of unlabeled samples without any knowledge of the ground truth labels (e.g., QUIRE, GraphDensity, Random); the other is selecting samples with the help of an initially trained supervised classifier based on a seed set of limited labeled samples. For the 1st setting, QUIRE and GraphDensity needs to calculate the kernel which is defined on vector. For the 2nd setting, some methods only depend on the otucome of the predict_proba (e.g., Uncertainty). You don't even need to provide the feature matrix or model to select unlabeled data:
For EER method, it's technically sound if you want to use a keras model because EER does not use the feature at all. However, we use the sklearn function
Note that, your model should implement However, some other methods use a specified model according to the paper which is trained and used inside the algorithm (e.g., LAL, BMDR, AURO, AUDI, HALC). Specifically, LAL uses a RF to extract feature of unlabeled data for score prediction, higher score means more valuable. But some features only can be provided by RF (average depth of the trees in the forest, out of bag estimation). If you want to use another model, you may have to design a new feature extraction method for score prediction. AURO and AUDI use a LabelRanking model which accepts instance-label pairs for training, and can provide special information that will be used in active selection. HALC uses 'one vs the rest' SVM for multi-label classification. The optimization of BMDR depends directly on a linear classification model according to the paper, if you want to change another model or another loss function, you may have to re-implement the optimization function. In this case, some specified models do not accept a 3D input shape. |
thanks for the quick and good answer. Sent with GitHawk |
The 2D feature matrix is obtained from your target model, I think it's ok to use it for AL selection. But use another model to get the proba prediction in AL may do harm to the performance. If you are labeling a real dataset, the better way is to use your target model. So I suggest you to use Uncertainty and If you are comparing with existing AL methods and going to write a paper, just make sure the target model for performance evaluation AND the 2D feature matrix for selection are the same for all compared methods. It's ok to use another model IF the compared method uses a specified model. |
i have downloaded LSTM .Now how to add it to matlab? |
I want to use the promising alipy library to perform active learning on a timeseries classifier model built with keras and tensorflow. The model is a LSTM, which leads to a 3D input shape.
Is there any way to use the alipy library then?
Up to now I changed you 10min-tutorial code so that it uses my own model. However the code stops at the very top when I initialize the Toolbox, because of the input shape of the xdata.
The text was updated successfully, but these errors were encountered: