AmpliGraph icon indicating copy to clipboard operation
AmpliGraph copied to clipboard

Refit a trained model with new triplets

Open aastha19 opened this issue 2 years ago • 3 comments

I have a dataset with new triplets and want to fit this data on an already trained model. The new dataset is in alliance with the data the model was trained on. Can this be achieved? If so, how?

aastha19 avatar Aug 18 '22 07:08 aastha19

Unfortunately this is not possible at the moment. I agree it would be a useful feature to open source. Keep an eye on future releases 😉

lukostaz avatar Aug 18 '22 07:08 lukostaz

You can try this using constant initializer, to initialize your new model with old embeddings. you also need to ensure that model dictionary(model.ent_to_idx, model.rel_to_idx) stays the same with the new data.

However this is not same as continuing training, since the optimizer states wont be the same.

sumitpai avatar Aug 18 '22 07:08 sumitpai

Unfortunately this is not possible at the moment. I agree it would be a useful feature to open source. Keep an eye on future releases 😉

@lukostaz does this mean we have to retrain the model from start if we want to add new triplets? What do you suggest for adding a KG in production that needs to be updated frequently? Thanks.

AbhiPawar5 avatar Aug 04 '23 05:08 AbhiPawar5