Skip to content

(WIP) compute the backward pass only once for all three slots in negative sampling#141

Open
AdrianKs wants to merge 1 commit intouma-pi1:masterfrom
AdrianKs:backward_pass_per_slot
Open

(WIP) compute the backward pass only once for all three slots in negative sampling#141
AdrianKs wants to merge 1 commit intouma-pi1:masterfrom
AdrianKs:backward_pass_per_slot

Conversation

@AdrianKs
Copy link
Copy Markdown
Collaborator

Add Flag to negative sampling to compute positive scores and backward pass only once for all three slots.

Unsure how to handle reciprocal relations in this setup. Can not provide direction, when scoring positive triples.

@AdrianKs AdrianKs requested a review from rgemulla August 31, 2020 08:41

# Whether to compute the backward pass after scoring against each slot (S, P, O)
# or once after scoring against all three slots.
# Does not work with reciprocal relations.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to "false".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also say that if false, positive triples are scored only once (else once per slot).

@rgemulla
Copy link
Copy Markdown
Member

Another thought: shouldn't we allow this for all trainers? We may either push the backward pass into _process_batch (slow, save mem) or keep it outside (fast, more mem).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants