Skip to content

Commit 60fbf84

Browse files
authored
Improve use of max_iter_harmony + max_iter_kmeans
1 parent 1a9ba5c commit 60fbf84

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

harmonypy/harmony.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ def run_harmony(
4141
nclust = None,
4242
tau = 0,
4343
block_size = 0.05,
44-
max_iter_kmeans = 10,
44+
max_iter_harmony = 10,
45+
max_iter_kmeans = 20,
4546
epsilon_cluster = 1e-5,
4647
epsilon_harmony = 1e-4,
4748
plot_convergence = False,
@@ -121,7 +122,7 @@ def run_harmony(
121122
np.random.seed(random_state)
122123

123124
ho = Harmony(
124-
data_mat, phi, phi_moe, Pr_b, sigma, theta, max_iter_kmeans,
125+
data_mat, phi, phi_moe, Pr_b, sigma, theta, max_iter_harmony, max_iter_kmeans,
125126
epsilon_cluster, epsilon_harmony, nclust, block_size, lamb_mat, verbose
126127
)
127128

@@ -130,8 +131,8 @@ def run_harmony(
130131
class Harmony(object):
131132
def __init__(
132133
self, Z, Phi, Phi_moe, Pr_b, sigma,
133-
theta, max_iter_kmeans, epsilon_kmeans,
134-
epsilon_harmony, K, block_size,
134+
theta, max_iter_harmony, max_iter_kmeans,
135+
epsilon_kmeans, epsilon_harmony, K, block_size,
135136
lamb, verbose
136137
):
137138
self.Z_corr = np.array(Z)
@@ -168,7 +169,7 @@ def __init__(
168169

169170
self.allocate_buffers()
170171
self.init_cluster()
171-
self.harmonize(self.max_iter_kmeans, self.verbose)
172+
self.harmonize(self.max_iter_harmony, self.verbose)
172173

173174
def result(self):
174175
return self.Z_corr

0 commit comments

Comments
 (0)