Accenture / AmpliGraph

Python library for Representation Learning on Knowledge Graphs https://docs.ampligraph.org
Apache License 2.0
2.16k stars 250 forks source link

Refit a trained model with new triplets #266

Open aastha19 opened 2 years ago

aastha19 commented 2 years ago

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?

lukostaz commented 2 years ago

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 😉

sumitpai commented 2 years ago

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.

AbhiPawar5 commented 1 year ago

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.