{"action":"created","comment":{"url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/comments/149703340","pull_request_review_id":75138372,"id":149703340,"diff_hunk":"@@ -0,0 +1,803 @@\n+#!/usr/bin/env python\n+# -*- coding: utf-8 -*-\n+#\n+# Author: Jayant Jain <jayantjain1992@gmail.com>\n+# Copyright (C) 2017 Radim Rehurek <me@radimrehurek.com>\n+# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html\n+\n+\n+\"\"\"\n+Python implementation of Poincare Embeddings, an embedding to capture hierarchical information,\n+described in [1]\n+\n+This module allows training a Poincare Embedding from a training file containing relations from\n+a transitive closure.\n+\n+\n+.. [1] https://arxiv.org/pdf/1705.08039.pdf\n+\n+\"\"\"\n+\n+\n+import csv\n+import itertools\n+import logging\n+import os\n+import random\n+import time\n+\n+from autograd import numpy as np, grad","path":"gensim/models/poincare.py","position":29,"original_position":29,"commit_id":"110fb1e6705a1c1b20defccd0eadc0d7b93b9fa9","original_commit_id":"5db8456b58d49bc6be587633afe0f9495ab1b52f","user":{"login":"janpom","id":460171,"avatar_url":"https://avatars3.githubusercontent.com/u/460171?v=4","gravatar_id":"","url":"https://api.github.com/users/janpom","html_url":"https://github.com/janpom","followers_url":"https://api.github.com/users/janpom/followers","following_url":"https://api.github.com/users/janpom/following{/other_user}","gists_url":"https://api.github.com/users/janpom/gists{/gist_id}","starred_url":"https://api.github.com/users/janpom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janpom/subscriptions","organizations_url":"https://api.github.com/users/janpom/orgs","repos_url":"https://api.github.com/users/janpom/repos","events_url":"https://api.github.com/users/janpom/events{/privacy}","received_events_url":"https://api.github.com/users/janpom/received_events","type":"User","site_admin":false},"body":"@jayantj Could we make it so that `autograd` is imported on demand only if `check_gradients` is requested? Looking at the code, this will require some refactoring (can't initialize `self.loss_grad` in the `__init__`), but it shouldn't be too hard to do.\r\n\r\nIt would also be nice to fail with a clear message if the import fails, such as \"please `pip install autograd` if you want to check gradients\" or something along those lines.\r\n\r\nThen I suppose we can get away without adding `autograd` to gensim dependencies.","created_at":"2017-11-08T15:32:41Z","updated_at":"2017-11-08T15:32:41Z","html_url":"https://github.com/RaRe-Technologies/gensim/pull/1696#discussion_r149703340","pull_request_url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1696","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/comments/149703340"},"html":{"href":"https://github.com/RaRe-Technologies/gensim/pull/1696#discussion_r149703340"},"pull_request":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1696"}},"in_reply_to_id":149583276},"pull_request":{"url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1696","id":150966475,"html_url":"https://github.com/RaRe-Technologies/gensim/pull/1696","diff_url":"https://github.com/RaRe-Technologies/gensim/pull/1696.diff","patch_url":"https://github.com/RaRe-Technologies/gensim/pull/1696.patch","issue_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/1696","number":1696,"state":"open","locked":false,"title":"[MRG] Poincare Model implementation","user":{"login":"jayantj","id":1329532,"avatar_url":"https://avatars0.githubusercontent.com/u/1329532?v=4","gravatar_id":"","url":"https://api.github.com/users/jayantj","html_url":"https://github.com/jayantj","followers_url":"https://api.github.com/users/jayantj/followers","following_url":"https://api.github.com/users/jayantj/following{/other_user}","gists_url":"https://api.github.com/users/jayantj/gists{/gist_id}","starred_url":"https://api.github.com/users/jayantj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayantj/subscriptions","organizations_url":"https://api.github.com/users/jayantj/orgs","repos_url":"https://api.github.com/users/jayantj/repos","events_url":"https://api.github.com/users/jayantj/events{/privacy}","received_events_url":"https://api.github.com/users/jayantj/received_events","type":"User","site_admin":false},"body":"Pure Python implementation of the Poincare model from [[1]](https://arxiv.org/pdf/1705.08039.pdf).\r\n\r\nTODO -\r\n\r\n- [x] Unit tests\r\n- [ ] Evaluating Gensim implementation and adding results to notebook\r\n- [ ] API conformity\r\n- [ ] Adding `KeyedVector` methods like `most_similar` to `PoincareKeyedVectors`\r\n- [x] More logging\r\n\r\n[[1] Poincaré Embeddings for Learning Hierarchical Representations](https://arxiv.org/pdf/1705.08039.pdf)","created_at":"2017-11-06T21:39:41Z","updated_at":"2017-11-08T15:32:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4e80c4aee38b7d5566c2ec3b954b946b345f8b49","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1696/commits","review_comments_url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1696/comments","review_comment_url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/1696/comments","statuses_url":"https://api.github.com/repos/RaRe-Technologies/gensim/statuses/110fb1e6705a1c1b20defccd0eadc0d7b93b9fa9","head":{"label":"RaRe-Technologies:poincare_model","ref":"poincare_model","sha":"110fb1e6705a1c1b20defccd0eadc0d7b93b9fa9","user":{"login":"RaRe-Technologies","id":12515886,"avatar_url":"https://avatars3.githubusercontent.com/u/12515886?v=4","gravatar_id":"","url":"https://api.github.com/users/RaRe-Technologies","html_url":"https://github.com/RaRe-Technologies","followers_url":"https://api.github.com/users/RaRe-Technologies/followers","following_url":"https://api.github.com/users/RaRe-Technologies/following{/other_user}","gists_url":"https://api.github.com/users/RaRe-Technologies/gists{/gist_id}","starred_url":"https://api.github.com/users/RaRe-Technologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaRe-Technologies/subscriptions","organizations_url":"https://api.github.com/users/RaRe-Technologies/orgs","repos_url":"https://api.github.com/users/RaRe-Technologies/repos","events_url":"https://api.github.com/users/RaRe-Technologies/events{/privacy}","received_events_url":"https://api.github.com/users/RaRe-Technologies/received_events","type":"Organization","site_admin":false},"repo":{"id":1349775,"name":"gensim","full_name":"RaRe-Technologies/gensim","owner":{"login":"RaRe-Technologies","id":12515886,"avatar_url":"https://avatars3.githubusercontent.com/u/12515886?v=4","gravatar_id":"","url":"https://api.github.com/users/RaRe-Technologies","html_url":"https://github.com/RaRe-Technologies","followers_url":"https://api.github.com/users/RaRe-Technologies/followers","following_url":"https://api.github.com/users/RaRe-Technologies/following{/other_user}","gists_url":"https://api.github.com/users/RaRe-Technologies/gists{/gist_id}","starred_url":"https://api.github.com/users/RaRe-Technologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaRe-Technologies/subscriptions","organizations_url":"https://api.github.com/users/RaRe-Technologies/orgs","repos_url":"https://api.github.com/users/RaRe-Technologies/repos","events_url":"https://api.github.com/users/RaRe-Technologies/events{/privacy}","received_events_url":"https://api.github.com/users/RaRe-Technologies/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RaRe-Technologies/gensim","description":"Topic Modelling for Humans","fork":false,"url":"https://api.github.com/repos/RaRe-Technologies/gensim","forks_url":"https://api.github.com/repos/RaRe-Technologies/gensim/forks","keys_url":"https://api.github.com/repos/RaRe-Technologies/gensim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RaRe-Technologies/gensim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RaRe-Technologies/gensim/teams","hooks_url":"https://api.github.com/repos/RaRe-Technologies/gensim/hooks","issue_events_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/events{/number}","events_url":"https://api.github.com/repos/RaRe-Technologies/gensim/events","assignees_url":"https://api.github.com/repos/RaRe-Technologies/gensim/assignees{/user}","branches_url":"https://api.github.com/repos/RaRe-Technologies/gensim/branches{/branch}","tags_url":"https://api.github.com/repos/RaRe-Technologies/gensim/tags","blobs_url":"https://api.github.com/repos/RaRe-Technologies/gensim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RaRe-Technologies/gensim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RaRe-Technologies/gensim/git/refs{/sha}","trees_url":"https://api.github.com/repos/RaRe-Technologies/gensim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RaRe-Technologies/gensim/statuses/{sha}","languages_url":"https://api.github.com/repos/RaRe-Technologies/gensim/languages","stargazers_url":"https://api.github.com/repos/RaRe-Technologies/gensim/stargazers","contributors_url":"https://api.github.com/repos/RaRe-Technologies/gensim/contributors","subscribers_url":"https://api.github.com/repos/RaRe-Technologies/gensim/subscribers","subscription_url":"https://api.github.com/repos/RaRe-Technologies/gensim/subscription","commits_url":"https://api.github.com/repos/RaRe-Technologies/gensim/commits{/sha}","git_commits_url":"https://api.github.com/repos/RaRe-Technologies/gensim/git/commits{/sha}","comments_url":"https://api.github.com/repos/RaRe-Technologies/gensim/comments{/number}","issue_comment_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/comments{/number}","contents_url":"https://api.github.com/repos/RaRe-Technologies/gensim/contents/{+path}","compare_url":"https://api.github.com/repos/RaRe-Technologies/gensim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RaRe-Technologies/gensim/merges","archive_url":"https://api.github.com/repos/RaRe-Technologies/gensim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RaRe-Technologies/gensim/downloads","issues_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues{/number}","pulls_url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls{/number}","milestones_url":"https://api.github.com/repos/RaRe-Technologies/gensim/milestones{/number}","notifications_url":"https://api.github.com/repos/RaRe-Technologies/gensim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RaRe-Technologies/gensim/labels{/name}","releases_url":"https://api.github.com/repos/RaRe-Technologies/gensim/releases{/id}","deployments_url":"https://api.github.com/repos/RaRe-Technologies/gensim/deployments","created_at":"2011-02-10T07:43:04Z","updated_at":"2017-11-08T13:39:41Z","pushed_at":"2017-11-08T14:32:01Z","git_url":"git://github.com/RaRe-Technologies/gensim.git","ssh_url":"git@github.com:RaRe-Technologies/gensim.git","clone_url":"https://github.com/RaRe-Technologies/gensim.git","svn_url":"https://github.com/RaRe-Technologies/gensim","homepage":"http://radimrehurek.com/gensim/","size":49960,"stargazers_count":5413,"watchers_count":5413,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2167,"mirror_url":null,"archived":false,"open_issues_count":162,"forks":2167,"open_issues":162,"watchers":5413,"default_branch":"develop"}},"base":{"label":"RaRe-Technologies:poincare","ref":"poincare","sha":"3ea373058d3b5f83dd9c4c93cd999fb22e28583e","user":{"login":"RaRe-Technologies","id":12515886,"avatar_url":"https://avatars3.githubusercontent.com/u/12515886?v=4","gravatar_id":"","url":"https://api.github.com/users/RaRe-Technologies","html_url":"https://github.com/RaRe-Technologies","followers_url":"https://api.github.com/users/RaRe-Technologies/followers","following_url":"https://api.github.com/users/RaRe-Technologies/following{/other_user}","gists_url":"https://api.github.com/users/RaRe-Technologies/gists{/gist_id}","starred_url":"https://api.github.com/users/RaRe-Technologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaRe-Technologies/subscriptions","organizations_url":"https://api.github.com/users/RaRe-Technologies/orgs","repos_url":"https://api.github.com/users/RaRe-Technologies/repos","events_url":"https://api.github.com/users/RaRe-Technologies/events{/privacy}","received_events_url":"https://api.github.com/users/RaRe-Technologies/received_events","type":"Organization","site_admin":false},"repo":{"id":1349775,"name":"gensim","full_name":"RaRe-Technologies/gensim","owner":{"login":"RaRe-Technologies","id":12515886,"avatar_url":"https://avatars3.githubusercontent.com/u/12515886?v=4","gravatar_id":"","url":"https://api.github.com/users/RaRe-Technologies","html_url":"https://github.com/RaRe-Technologies","followers_url":"https://api.github.com/users/RaRe-Technologies/followers","following_url":"https://api.github.com/users/RaRe-Technologies/following{/other_user}","gists_url":"https://api.github.com/users/RaRe-Technologies/gists{/gist_id}","starred_url":"https://api.github.com/users/RaRe-Technologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaRe-Technologies/subscriptions","organizations_url":"https://api.github.com/users/RaRe-Technologies/orgs","repos_url":"https://api.github.com/users/RaRe-Technologies/repos","events_url":"https://api.github.com/users/RaRe-Technologies/events{/privacy}","received_events_url":"https://api.github.com/users/RaRe-Technologies/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RaRe-Technologies/gensim","description":"Topic Modelling for Humans","fork":false,"url":"https://api.github.com/repos/RaRe-Technologies/gensim","forks_url":"https://api.github.com/repos/RaRe-Technologies/gensim/forks","keys_url":"https://api.github.com/repos/RaRe-Technologies/gensim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RaRe-Technologies/gensim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RaRe-Technologies/gensim/teams","hooks_url":"https://api.github.com/repos/RaRe-Technologies/gensim/hooks","issue_events_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/events{/number}","events_url":"https://api.github.com/repos/RaRe-Technologies/gensim/events","assignees_url":"https://api.github.com/repos/RaRe-Technologies/gensim/assignees{/user}","branches_url":"https://api.github.com/repos/RaRe-Technologies/gensim/branches{/branch}","tags_url":"https://api.github.com/repos/RaRe-Technologies/gensim/tags","blobs_url":"https://api.github.com/repos/RaRe-Technologies/gensim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RaRe-Technologies/gensim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RaRe-Technologies/gensim/git/refs{/sha}","trees_url":"https://api.github.com/repos/RaRe-Technologies/gensim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RaRe-Technologies/gensim/statuses/{sha}","languages_url":"https://api.github.com/repos/RaRe-Technologies/gensim/languages","stargazers_url":"https://api.github.com/repos/RaRe-Technologies/gensim/stargazers","contributors_url":"https://api.github.com/repos/RaRe-Technologies/gensim/contributors","subscribers_url":"https://api.github.com/repos/RaRe-Technologies/gensim/subscribers","subscription_url":"https://api.github.com/repos/RaRe-Technologies/gensim/subscription","commits_url":"https://api.github.com/repos/RaRe-Technologies/gensim/commits{/sha}","git_commits_url":"https://api.github.com/repos/RaRe-Technologies/gensim/git/commits{/sha}","comments_url":"https://api.github.com/repos/RaRe-Technologies/gensim/comments{/number}","issue_comment_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/comments{/number}","contents_url":"https://api.github.com/repos/RaRe-Technologies/gensim/contents/{+path}","compare_url":"https://api.github.com/repos/RaRe-Technologies/gensim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RaRe-Technologies/gensim/merges","archive_url":"https://api.github.com/repos/RaRe-Technologies/gensim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RaRe-Technologies/gensim/downloads","issues_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues{/number}","pulls_url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls{/number}","milestones_url":"https://api.github.com/repos/RaRe-Technologies/gensim/milestones{/number}","notifications_url":"https://api.github.com/repos/RaRe-Technologies/gensim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RaRe-Technologies/gensim/labels{/name}","releases_url":"https://api.github.com/repos/RaRe-Technologies/gensim/releases{/id}","deployments_url":"https://api.github.com/repos/RaRe-Technologies/gensim/deployments","created_at":"2011-02-10T07:43:04Z","updated_at":"2017-11-08T13:39:41Z","pushed_at":"2017-11-08T14:32:01Z","git_url":"git://github.com/RaRe-Technologies/gensim.git","ssh_url":"git@github.com:RaRe-Technologies/gensim.git","clone_url":"https://github.com/RaRe-Technologies/gensim.git","svn_url":"https://github.com/RaRe-Technologies/gensim","homepage":"http://radimrehurek.com/gensim/","size":49960,"stargazers_count":5413,"watchers_count":5413,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2167,"mirror_url":null,"archived":false,"open_issues_count":162,"forks":2167,"open_issues":162,"watchers":5413,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1696"},"html":{"href":"https://github.com/RaRe-Technologies/gensim/pull/1696"},"issue":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/1696"},"comments":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/1696/comments"},"review_comments":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1696/comments"},"review_comment":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1696/commits"},"statuses":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/statuses/110fb1e6705a1c1b20defccd0eadc0d7b93b9fa9"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"janpom"}}