Skip to content

Commit

Permalink
Merge branch 'experiments' of github-personal:Lagergren-Lab/victree i…
Browse files Browse the repository at this point in the history
…nto experiments
  • Loading branch information
toyo97 committed Oct 28, 2023
2 parents 56c2a1e + 897728b commit 3c6fbca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/inference/victree.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,12 +535,13 @@ def make_input(data: anndata.AnnData | str, cc_layer: str | None = 'copy',
# default params
tree_nodes = n_nodes if fix_tree is None else fix_tree.number_of_nodes()
obs_bins, obs_cells = obs.shape
qT_temp = 1. if fix_tree is not None else obs_bins

if config is None:
config = Config(chain_length=obs_bins, n_cells=obs_cells, n_nodes=tree_nodes,
chromosome_indexes=dh.get_chr_idx(), debug=debug, step_size=step_size,
sieving_size=sieving[0], n_sieving_iter=sieving[1], wis_sample_size=wis_sample_size,
split=split, qT_temp=obs_bins)
split=split, qT_temp=qT_temp)
else:
config.chromosome_indexes = dh.get_chr_idx()

Expand Down
2 changes: 2 additions & 0 deletions tests/test_vardists/test_qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def test_entropy_lower_for_random_transitions_than_uniform_transitions(self):
print(f"Entropy random eta_2: {rand_res} - uniform eta_2: {uniform_res}")
self.assertLess(rand_res, uniform_res)

@unittest.skip("wrong code")
def test_cross_entropy_lower_for_random_transitions_than_deterministic_transitions(self):
K = 3
M = 5
Expand All @@ -103,6 +104,7 @@ def test_cross_entropy_lower_for_random_transitions_than_deterministic_transitio
cross_entropy_rand = qc_1.neg_cross_entropy_arc(q_eps, 0, 1)
print(f"Random: {cross_entropy_rand}")
qc_2 = qC(config_1).initialize()
# FIXME: m goes over two cycles but only used once
for k in range(K):
for m in range(M - 1):
qc_2.eta1 = torch.log(torch.zeros(K, A) + 0.001)
Expand Down

0 comments on commit 3c6fbca

Please sign in to comment.