Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] Poincare l2 regularization #1734

Merged
merged 192 commits into from
Dec 4, 2017
Merged

Conversation

jayantj
Copy link
Contributor

@jayantj jayantj commented Nov 22, 2017

Adds l2-regularization for Poincare embeddings, which improves results and results in models much more similar to the models visualized in the original paper. To be merged post #1700

Without regularization, the model looks like this -
mammals_200_ep

The problem with this is that most of the nodes are too close to the boundary. In order to prevent this, l2-regularization is added to only the parent node in the training hypernymy relations, which results in the following model -

mammals_350_ep_l2_reg

Also adds cleaner handling of autograd, where the import is not conditional, however if autograd cannot be imported, gradient checking is automatically skipped along with a warning.

@@ -91,6 +91,8 @@ def __init__(self, train_data, size=50, alpha=0.1, negative=10, workers=1, epsil
Number of threads to use for training the model.
epsilon : float, optional
Constant used for clipping embeddings below a norm of one.
regularization_coeff : float, optional
Copy link
Contributor

Choose a reason for hiding this comment

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

Can the L2 regularization be disabled? Setting regularization_coeff = 0.0 should do it, correct? Might be worth mentioning here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's correct. Good point, adding.

@menshikh-iv menshikh-iv merged commit 4ab63c6 into poincare Dec 4, 2017
@jayantj jayantj mentioned this pull request Dec 4, 2017
@menshikh-iv menshikh-iv deleted the poincare_l2_regularization branch July 5, 2018 17:03
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.

3 participants