Skip to content

Commit

Permalink
increase noise, re-run targeted tuto
Browse files Browse the repository at this point in the history
  • Loading branch information
dbdimitrov committed Jan 17, 2024
1 parent f45f911 commit 1543d16
Show file tree
Hide file tree
Showing 2 changed files with 237 additions and 212 deletions.
445 changes: 235 additions & 210 deletions docs/source/notebooks/targeted.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions liana/method/fun/_causalnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def find_causalnet(
# assign 0 penalties to input/output nodes, missing_penalty to missing nodes
# add a small amount of noise to the penalties to ensure reproducible solutions
rng = np.random.default_rng(seed=seed)
c_node_penalties = {k: node_penalties.get(k, missing_penalty) + rng.uniform(min_penalty/100, min_penalty/10)
c_node_penalties = {k: node_penalties.get(k, missing_penalty) + rng.uniform(min_penalty/20, min_penalty/10)
if k not in measured_nodes else 0.0 for k in prior_graph.vertices}

_logg("Building CORNETO problem...", verbose=verbose)
Expand All @@ -186,7 +186,7 @@ def find_causalnet(

# E is the variable with 1 if edge activates or inhibits, 0 otherwise
E = P.symbols['reaction_sends_activation_c0'] + P.symbols['reaction_sends_inhibition_c0']
W = rng.uniform(edge_penalty/100, edge_penalty/10, size=E.shape)
W = rng.uniform(edge_penalty/20, edge_penalty/10, size=E.shape)
P.add_objectives(W.T @ E)

_logg(f"Solving with {solver}...", verbose=verbose)
Expand Down

0 comments on commit 1543d16

Please sign in to comment.