forked from piskvorky/gensim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated RandomState (deprecated from numpy) to default_rng (Generator)
This is regarding the issue piskvorky#2782 . Here are the benchmarks of before and after updating: Before Update After Update Poincare Ran 42 tests in 0.418s Ran 42 tests in 0.417s test_lda Ran 48 tests in 223.845s Ran 48 tests in 225.561s utils Ran 24 tests in 0.007s Ran 24 tests in 0.007s test_matutils Ran 18 tests in 0.071s Ran 18 tests in 0.070s word2vec Ran 79 tests in 58.149s Ran 79 tests in 57.950s I don't find a big difference in time taken. However I feel it is good to be updated along with numpy.
- Loading branch information
1 parent
c0f384c
commit 8443280
Showing
8 changed files
with
45 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from poincare import PoincareModel, PoincareRelations | ||
from time import time | ||
import numpy as np | ||
t1 = time() | ||
file_path = "C:\\Users\\sagar\\gensim\\gensim\\test\\test_data\\poincare_hypernyms_large.tsv" | ||
model = PoincareModel(PoincareRelations(file_path), negative=2) | ||
model.train(epochs=50) | ||
t2 = time() | ||
print(t2-t1) | ||
#print((np.random.randint.__doc__)) | ||
|
||
|
||
print(np.random.RandomState.rand.__doc__) | ||
print(np.random.default_rng(1).gamma.__doc__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters