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

Adding seed for reproducibility and sampling methods #344

Open
wants to merge 67 commits into
base: 1.7.0
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
e4d8871
sampling and seed
rwilfong Jul 31, 2024
22b0318
now it runs
stewarthe6 Jul 19, 2024
30ea360
kfold changes
stewarthe6 Jul 19, 2024
dc1f7c4
seed test
rwilfong Jul 31, 2024
7b13967
ruff linter suggestions
rwilfong Jul 31, 2024
6fb1c62
updated kfoldregression
rwilfong Aug 1, 2024
480e5f1
Merge remote-tracking branch 'upstream/1.7.0' into 1.7.0
stewarthe6 Sep 11, 2024
fc24463
added imblearn to pip requirements
stewarthe6 Sep 11, 2024
561c3bb
unpin imblearn
stewarthe6 Sep 11, 2024
49dc67b
Clean up unused random_state or seed parameters or assignments.
stewarthe6 Sep 11, 2024
b41b7d5
fixed merging error
stewarthe6 Sep 11, 2024
b65ba09
Fixed find and replace bug
stewarthe6 Sep 11, 2024
84babd2
make_dc_model does not need random_state or seed arguments
stewarthe6 Sep 11, 2024
ecf23bd
fhnew changes
rwilfong Sep 12, 2024
a821f6a
Changed constructor of ProductionSplitter to call Splitting's init fu…
stewarthe6 Sep 12, 2024
319b2f0
resolving errors
rwilfong Sep 12, 2024
31f3d5f
removed heads
rwilfong Sep 12, 2024
d074f65
removed unused library
rwilfong Sep 12, 2024
b0ecc05
Merge remote-tracking branch 'upstream/1.7.0' into 1.7.0
stewarthe6 Sep 12, 2024
2992bdf
Added more models for seeding test.
stewarthe6 Sep 12, 2024
ccebaed
Fixed seed for GCNModel. Should pass regularly now.
stewarthe6 Sep 12, 2024
dcc4809
Set seed to guarantee resuts in class_config_delaney_fit_nn_ecfp.json
stewarthe6 Sep 12, 2024
922bf0c
Moved 'test' from suffix to prefix
stewarthe6 Sep 18, 2024
82838d1
Renamed these test files to start with test_ so they're caught by the…
stewarthe6 Sep 19, 2024
4e471cb
Changed MultitaskScaffoldSplit and GeneticAlgorithm to use a Generate…
stewarthe6 Sep 19, 2024
baa5478
Added test for MTSS seed and fixed a few cases were the wrong random …
stewarthe6 Sep 19, 2024
4eb4ee4
renamed this file to match wahts in test_seed_splitting.py
stewarthe6 Sep 19, 2024
4588a9d
renamed this to match the test
stewarthe6 Sep 19, 2024
ff58d02
Removed try except blocks in test code. We need to see these errors
stewarthe6 Sep 24, 2024
0028ed7
Added seed to this test so that it passes more consistently
stewarthe6 Sep 24, 2024
0c83b6b
combined_training_data now accounts for synthetic datasets
stewarthe6 Sep 24, 2024
ada3ea8
accept changes
rwilfong Sep 24, 2024
4dd5d99
integrate changes
rwilfong Sep 24, 2024
0a616b2
set uncertainty false for classification test since it is unsupported…
stewarthe6 Sep 24, 2024
16c2a4a
update branchMerge branch '1.7.0' of https://github.com/rwilfong/AMPL…
rwilfong Sep 25, 2024
c3b1922
updated tests
rwilfong Sep 25, 2024
f2a30a9
resolve errors
rwilfong Sep 25, 2024
410f03d
Added seed to test_balancing_transformer for more consistent outputs
stewarthe6 Sep 25, 2024
f247893
added a test to make sure that multitask problems don't work with SMOTE
stewarthe6 Sep 25, 2024
2e03fef
Used parameter to determine if SMOTE or undersampling is being used
stewarthe6 Sep 25, 2024
b48ed02
Added a seed to this test for more consistent results
stewarthe6 Sep 25, 2024
567264a
Changed balancing transformer to just check to see if the weights cha…
stewarthe6 Sep 26, 2024
627cc20
Set the seed to make sure the number of positive and negative compoun…
stewarthe6 Sep 26, 2024
8decc0e
Removed unnecessary loop and printed out results from the perf_data test
stewarthe6 Sep 30, 2024
317cc29
accumulate_preds ignores the id parameter for SimpleRegressionPerfDat…
stewarthe6 Sep 30, 2024
5055889
the positive and negative counts are inconsistent, instead just check…
stewarthe6 Sep 30, 2024
6d0abbd
Merge branch 'ATOMScience-org:1.7.0' into 1.7.0
stewarthe6 Oct 2, 2024
16d50f8
Undo transformations before calculating mean and std of predictions
stewarthe6 Oct 28, 2024
3e58819
Merge branch '1.7.0' of github.com:rwilfong/AMPL into 1.7.0
stewarthe6 Oct 28, 2024
0280941
Removed pdb imports
stewarthe6 Oct 28, 2024
a4c2b83
Updated help for 'seed' input
stewarthe6 Nov 27, 2024
8e29047
Removed commented out seed
stewarthe6 Nov 27, 2024
268ba05
model_retrian has an option to either keep or discard the saved seed.…
stewarthe6 Nov 27, 2024
17ba026
Pass on keep_seed argument
stewarthe6 Nov 27, 2024
b2a0c5a
Looping through all folds is redundant
stewarthe6 Dec 2, 2024
60ed670
Added option to keep the same random seed when retraining a model. De…
stewarthe6 Dec 2, 2024
c5e634f
Move common functions to integrative_utilities
stewarthe6 Dec 3, 2024
36c38ec
Move common functions to integrative_utilities
stewarthe6 Dec 3, 2024
d11ee2c
deleted unused imports
stewarthe6 Dec 3, 2024
a089d1f
moved params to json files
stewarthe6 Dec 3, 2024
271c502
Prevent divide by zero case if the model never learns
stewarthe6 Dec 3, 2024
48635cb
Moved pandas import over to integrative_utilities
stewarthe6 Dec 4, 2024
0c67471
Added a seed here for reproducability
stewarthe6 Dec 4, 2024
524d804
Testing SMOTE and balancing transformer
stewarthe6 Dec 5, 2024
a057ba4
global seed warning
rwilfong Jan 13, 2025
58e101d
Merge branch '1.7.0' of https://github.com/rwilfong/AMPL into 1.7.0
rwilfong Jan 13, 2025
10c4ba7
global seed warning
rwilfong Jan 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
global seed warning
  • Loading branch information
rwilfong committed Jan 13, 2025
commit a057ba49f88d017ac099adb72c51603bb6a16fad
5 changes: 5 additions & 0 deletions atomsci/ddm/pipeline/random_seed.py
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@
import random
import torch
import tensorflow as tf
import logging
logging.basicConfig(format='%(asctime)-15s %(message)s')
#----------------------------------------------------------------------------------
class RandomStateGenerator:
"""
@@ -25,6 +27,9 @@ def __init__(self, params=None, seed=None):
self.set_seed(self.seed)

def set_seed(self, seed):
log = logging.getLogger('ATOM')
log.warning("The global seed is being set to %d, for reproducibility. Note that this action "
"will synchronize the randonmess across all libraries which may impact the randomness of other parts of the pipeline.", seed)
"""Set the seed for all relevant libraries."""

global _seed, _random_state
Copy link
Collaborator

Choose a reason for hiding this comment

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

do these need to be global