Comments (3)
Do you have any hints where the problem comes from and how to fix it? I took a closer look at the QuatEInteraction and realised that a buffer called table is created. Could the problem perhaps lie here?
I think this buffer should be unrelated (it is created only once, and pretty small, too).
How does self.model
look like?
The default setting of QuatE (the full model configuration, not the interaction) uses a regularizer, and it seems as if you use a custom training loop, so my best guess would be that the regularization term keeps accumulating without being back-propagated; in this case, torch would not be able to release tensors from previous batches.
from pykeen.
Thanks for your answer and sorry for my late reply!
I use the default QuatE model from the pykeen library here
It looks like this
QuatE(
(loss): BCEWithLogitsLoss()
(interaction): QuatEInteraction()
(entity_representations): ModuleList(
(0): Embedding(
(regularizer): LpRegularizer()
(_embeddings): Embedding(3007, 400)
)
)
(relation_representations): ModuleList(
(0): Embedding(
(regularizer): LpRegularizer()
(_embeddings): Embedding(12, 400)
)
)
(weight_regularizers): ModuleList()
)
Are you talking about the weight_regularizers
or the LpRegularizer()
?
from pykeen.
I was talking about the two LpRegularizer
instances shown as entity_representations[0].regularizer
and relation_representations[0].regularizer
; weight_regularizers
is just an empty list 🙂
You can either
- disable the two regularizers by providing
model = QuatE(
...,
entity_regularizer=None,
relation_regularizer=None,
)
- or collect the regularization term by calling
model.collect_regularization_term
; you can either ignore this term (but in this case I would suggest to use the previous option instead), or add this to the loss before calculating the gradients.
As background info:
weight_regularizers
are regularizers that calculate a regularization term on all weights (of soem tensor, e.g., the relation embedding matrix);- in contrast, the
LpRegularizer
s you see above only calculate terms from the "activated" embeddings, i.e., the rows of the embedding matrix which are used in the current batch (and thus may also receive a non-zero gradient).
from pykeen.
Related Issues (20)
- Possible issue with model evaluation when using datasets with inverse triples HOT 1
- RGCN RuntimeError: trying to backward through graph a second time. (has parameters but no reset_parameters) HOT 2
- Training loop does not update relation representations when continuing training HOT 2
- from pykeen.pipeline import pipeline, pipeline issue HOT 3
- Evaluating metrics on many subsets with multiple models HOT 2
- Shape Mismatch upon initializing pretrained ComplEx embeddings HOT 2
- TransE - CUDA out of memory HOT 3
- Importing model_resolver HOT 2
- Getting Embeddings of the Entity and Relations HOT 13
- RGCN Hyper parameter optimization error HOT 1
- MatKG HOT 1
- HPO_Pipeline fails on AutoSF models HOT 1
- Unable to reproduce TransE experiment
- EarlyStopper: show progress bar
- Cosine Annealing with Warm Restart LR Scheduler recieving an unexpected kwarg `T_i` HOT 1
- OOM Crash on MPS/Apple silicon HOT 2
- Reason for omitting validation inference triples from filtering when doing test evaluation in inductive lp example HOT 2
- tqdm progressbar is still shown although setting `use_tqdm=False`
- create_inverse_triples=True fails for the ILPC datasets
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pykeen.