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

Improve use of max_iter_harmony + max_iter_kmeans #8

Merged
merged 1 commit into from
Aug 11, 2020
Merged
Changes from all commits
Commits
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
11 changes: 6 additions & 5 deletions harmonypy/harmony.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def run_harmony(
nclust = None,
tau = 0,
block_size = 0.05,
max_iter_kmeans = 10,
max_iter_harmony = 10,
max_iter_kmeans = 20,
epsilon_cluster = 1e-5,
epsilon_harmony = 1e-4,
plot_convergence = False,
Expand Down Expand Up @@ -121,7 +122,7 @@ def run_harmony(
np.random.seed(random_state)

ho = Harmony(
data_mat, phi, phi_moe, Pr_b, sigma, theta, max_iter_kmeans,
data_mat, phi, phi_moe, Pr_b, sigma, theta, max_iter_harmony, max_iter_kmeans,
epsilon_cluster, epsilon_harmony, nclust, block_size, lamb_mat, verbose
)

Expand All @@ -130,8 +131,8 @@ def run_harmony(
class Harmony(object):
def __init__(
self, Z, Phi, Phi_moe, Pr_b, sigma,
theta, max_iter_kmeans, epsilon_kmeans,
epsilon_harmony, K, block_size,
theta, max_iter_harmony, max_iter_kmeans,
epsilon_kmeans, epsilon_harmony, K, block_size,
lamb, verbose
):
self.Z_corr = np.array(Z)
Expand Down Expand Up @@ -168,7 +169,7 @@ def __init__(

self.allocate_buffers()
self.init_cluster()
self.harmonize(self.max_iter_kmeans, self.verbose)
self.harmonize(self.max_iter_harmony, self.verbose)

def result(self):
return self.Z_corr
Expand Down