Skip to content

Commit

Permalink
setting random seeds for get_df
Browse files Browse the repository at this point in the history
  • Loading branch information
beckynevin committed Oct 28, 2024
1 parent d620f6c commit a87334d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions deepuq/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ class DataPreparation:
def __init__(self):
self.data = None

def generate_df(self, size_df, noise, dim, injection, uniform, verbose):
def generate_df(self, size_df, noise, dim, injection, uniform,
verbose, rs_prior=42, rs_uniform=40):
if verbose:
print("generating dataframe")
if uniform:
Expand All @@ -154,7 +155,7 @@ def generate_df(self, size_df, noise, dim, injection, uniform, verbose):
else:
size_df_gen = size_df
if dim == "0D":
self.sample_params_from_prior(size_df_gen)
self.sample_params_from_prior(size_df_gen, seed=rs_prior)
if verbose:
print("injecting this noise", noise)
print(
Expand Down Expand Up @@ -206,7 +207,7 @@ def generate_df(self, size_df, noise, dim, injection, uniform, verbose):
low=[0, 1, -1.5],
high=[0.01, 10, 1.5],
n_params=3,
seed=42,
seed=rs_prior,
)
model_inputs, model_outputs = self.simulate_data_2d(
size_df_gen,
Expand All @@ -229,7 +230,7 @@ def generate_df(self, size_df, noise, dim, injection, uniform, verbose):
model_outputs,
size_df,
verbose=verbose,
rs=40,
rs=rs_uniform,
)
if verbose:
print("size after uniform", np.shape(model_inputs))
Expand Down

0 comments on commit a87334d

Please sign in to comment.