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

Updated RandomState (deprecated from numpy) to default_rng (Generator) #3220

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Commits on Aug 28, 2021

  1. 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.
    SagarDollin committed Aug 28, 2021
    Configuration menu
    Copy the full SHA
    8443280 View commit details
    Browse the repository at this point in the history
  2. Update word2vec.py

    For some reason the test_word2vec's  function test_compute_training_loss() fails when we use default_rng instead of RandomState, therefore reverting the changes only for word2vec
    SagarDollin committed Aug 28, 2021
    Configuration menu
    Copy the full SHA
    82634c9 View commit details
    Browse the repository at this point in the history
  3. Delete test_poincare.py

    SagarDollin committed Aug 28, 2021
    Configuration menu
    Copy the full SHA
    4bbccb0 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2021

  1. Resolved some dependencies related to RandomState

    resolved some dependencies on RandomState. randint is a method of RandomState , however not supported in Generator. For Generator we use integers. Also fixed a small error about inferred variable (related to index error)
    SagarDollin committed Aug 29, 2021
    Configuration menu
    Copy the full SHA
    78f1b78 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dc67c5f View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2021

  1. fixing test_failures that were caused due to a different intitializat…

    …ion of random function
    
    Since we are using a totally different random Generator which is not RandomState, therefore there will be differences in intilizations of weights or any random initialization, than that of last versions. The hardcoded values in tests will fail therfore. I had to change these hardcoded values to the new resluts we get.
    
    Example in test_similarity_mertics , I  added a delta of 5.0e-06 to incorporate small changes.
    
    Note in test_ensemblelda i had to remove 2 tests as these two test were comparing previously saved model with new model , which will be not same as we are using different Random Generator.
    
    I'm not an expert in all the models therefore a review for the changes in test files is required.
    SagarDollin committed Aug 30, 2021
    Configuration menu
    Copy the full SHA
    0789a81 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f077516 View commit details
    Browse the repository at this point in the history

Commits on Sep 2, 2021

  1. fixed falke8 related styling errors

    Sorry for the inconvenience . Pushing after fixing flake8 related styling of code issues
    SagarDollin committed Sep 2, 2021
    Configuration menu
    Copy the full SHA
    f3e54cd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ab3c340 View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2022

  1. Configuration menu
    Copy the full SHA
    a6e855d View commit details
    Browse the repository at this point in the history