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
Setting up a PoolBaseActiveLearner without initialization. #10
Comments
Hi,
The other option you mentioned is also possible, for example if your training data changes. In this case you can call |
Thank you! However, I am still encountering issues. I am loading a pre-trained model from file, then initialising an active learner (on no new initialisation data as this model has already been trained on some training data). Then as you suggested, I'm setting
However, when I then try to access the classifier, e.g. by running:
I get the following error: Could you suggest how to proceed? |
Hi @chschroeder, do you have any update on this error? Thanks! :) |
Hi @HannahKirk, sorry I completely missed your last edit. But now I think I have understood what your intention is:
This is something that probably will not be possible right now without any hassle but might be a valid use case to include in the future. For now, you can try the following:
This manually initializes some objects which would otherwise be set up in |
Thanks @chschroeder. I think even with the suggested changes, there are still some problems:
Perhaps the pool is has not been moved Thanks :) |
Yes, this error makes sense, we need to prepare the classifier as if fit would have been called. Append the following line to the code above:
Edit: Fixed device reference. |
Thanks @chschroeder, one remaining point. What does the |
That was a copy/paste remnant, sorry :). Fixed it above. What I am doing here is just copying the code from the classifier |
Hi @chschroeder, I have followed this instructions in the code:
However, when I now try and use this model for querying with: How should I proceed? I thought the pre-trained model would now have been initialised with the learner so that the learner could be used to query the pool. I can initialise the data in a hacky way but selecting 0 samples with:
But there may be a better solution Thanks :) P.S the full source of the exception is:
|
You were almost there :). Sorry, I had no time to try this myself last week, and this distant trial and error takes a bit longer. I used your function and changed this:
to this:
This got me so far that that I could use At second thought I am questioning now what we even get from the |
Hi, just to give an update: this issue has not been forgotten. I would call your use case here "pre-initialized" or "externally initialized". Similar problems regarding the API exist for cold start active learning for which we now have a notebook. Both of these use cases are difficult to realize without breaking the current API. The solution that I would prefer will likely generalize the initialization mechanism, but this will have to wait until a next major version 2.0.0. |
Signed-off-by: Christopher Schröder <chschroeder@users.noreply.github.com>
Hi,
I am training a transformers model in a separate script over a pre-defined training set. I want to then use this classifier to query examples from the unlabelled pool. I can load the trained model from pre-trained pytorch model files or from
PoolBasedActiveLearner.load('test-model/active_leaner.pkl')
.However, I then don't want to initialise this model as it has already been trained on a portion of the labelled data. Is it possible to still query over data i.e.
learner.query()
without running the initialization steplearner.initialize_data(x_indices_train, y_train, x_indices_validation=val_indices)
?Alternatively is it possible to still run this initialisation step but without running any training, i.e. just ignoring all indices for initialisation or setting the number of initialisation examples to zero in
x_indices_initial = random_initialization(y_train, n_samples=0)
.Really appreciate your help on this one!
Thanks :)
The text was updated successfully, but these errors were encountered: