Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Quantized model artifacts are not accessible as class attributes #984

Open
denver1117 opened this issue Jan 11, 2020 · 2 comments
Open

Quantized model artifacts are not accessible as class attributes #984

denver1117 opened this issue Jan 11, 2020 · 2 comments

Comments

@denver1117
Copy link

It does not appear that the model artifacts needed to explore quantized models are made public, specifically with the python module.

For instance, with a non-quantized supervised model class, you can access the input and output matrix explicitly as numpy objects:

model.get_input_matrix()
model.get_output_matrix()

In this case you are able to access all of the model artifacts needed to manually get word and sentence vectors, perform the dot product for prediction, etc.

For quantized models, it is very opaque what has gone on under the hood and where the artifacts are. The input matrix usually accessible with model.get_input_matrix() goes away. This is understandable. But presumably some artifacts exist that map words to their nearest centroid, and that map centroids back into the full dimensional input matrix space. These seemingly must exist in order to produce word/sentence vectors for quantized models as part of the predict step.

Where are these attributes? Can they be accessed with the python module? I see no new attributes created in either the python model object or the pybind object model.f after quantization.

These would be much appreciated in efforts to further explore fasttext quantization. While I understand the methods (predict, get_word_vector, get_sentence_vector, etc.) function appropriately after quantization, it is very much a black box to the end user.

@Celebio
Copy link
Member

Celebio commented Jan 14, 2020

Hi @denver1117 ,
Thank you for your suggestion, it makes sense. We will add it to our feature request list.

Best regards,
Onur

@denver1117
Copy link
Author

Great thanks 💯

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants