Skip to content

Commit

Permalink
running 5k
Browse files Browse the repository at this point in the history
  • Loading branch information
beckynevin committed Aug 2, 2024
1 parent 93c4b7c commit 4b4d1f7
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 124 deletions.
126 changes: 70 additions & 56 deletions notebooks/fig1.ipynb

Large diffs are not rendered by default.

92 changes: 47 additions & 45 deletions notebooks/model_validation.ipynb

Large diffs are not rendered by default.

58 changes: 41 additions & 17 deletions notebooks/sigma_in_sigma_out.ipynb

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ def simulate_data(
if vary_sigma:
print("YES WERE VARYING SIGMA")
new_sig = self.get_sigma_m(sigma, m)
print('new sig', new_sig)
ε = rs.normal(
loc=0, scale=new_sig, size=(len(x), thetas.shape[0])
)
Expand Down
14 changes: 9 additions & 5 deletions src/scripts/DeepEnsemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,17 +328,13 @@ def beta_type(value):
prescription = config.get_item("data", "data_prescription", "DE")
injection = config.get_item("data", "data_injection", "DE")
dim = config.get_item("data", "data_dimension", "DE")
sigma = DataPreparation.get_sigma(
noise, inject_type=injection, data_dimension=dim
)
print(f"inject type is {injection}, dim is {dim}, sigma is {sigma}")
if config.get_item("data", "generatedata", "DE", raise_exception=False):
# generate the df
print("generating the data")
data = DataPreparation()
if dim == "0D":
data.sample_params_from_prior(size_df)
print("injecting this noise", noise, sigma)
print("injecting this noise", noise)
if injection == "feature":
vary_sigma = True
print('are we varying sigma', vary_sigma)
Expand All @@ -351,6 +347,10 @@ def beta_type(value):
vary_sigma=vary_sigma
)
elif injection == "predictive":
sigma = DataPreparation.get_sigma(
noise, inject_type=injection, data_dimension=dim
)
print(f"inject type is {injection}, dim is {dim}, sigma is {sigma}")
data.simulate_data(
data.params,
sigma,
Expand All @@ -371,6 +371,10 @@ def beta_type(value):
df[key] = torch.tensor(value)
elif dim == "2D":
print("2D data")
sigma = DataPreparation.get_sigma(
noise, inject_type=injection, data_dimension=dim
)
print(f"inject type is {injection}, dim is {dim}, sigma is {sigma}")
data.sample_params_from_prior(
size_df,
low=[0, 1, -1.5],
Expand Down

0 comments on commit 4b4d1f7

Please sign in to comment.