Commit 757f4126 authored by lucas_miranda's avatar lucas_miranda
Browse files

Modified cluster purity computation. Instead of KNN, we now look at...

Modified cluster purity computation. Instead of KNN, we now look at neighborhoods of a predefined radius
parent f4fe0cae
......@@ -252,31 +252,12 @@ def test_dead_neuron_control():
assert tf.keras.callbacks.History == type(fit)
# noinspection PyUnresolvedReferences
def test_entropy_regulariser():
X = np.random.uniform(0, 10, [1500, 5])
y = np.random.randint(0, 2, [1500, 1])
test_model = tf.keras.Sequential()
test_model.add(tf.keras.layers.Dense(1))
test_model.add(deepof.model_utils.Entropy_regulariser(1.0))
test_model.compile(
loss=tf.keras.losses.binary_crossentropy,
optimizer=tf.keras.optimizers.SGD(),
)
fit = test_model.fit(X, y, epochs=10, batch_size=100)
assert type(fit) == tf.keras.callbacks.History
def test_find_learning_rate():
X = np.random.uniform(0, 10, [1500, 5])
y = np.random.randint(0, 2, [1500, 1])
test_model = tf.keras.Sequential()
test_model.add(tf.keras.layers.Dense(1))
test_model.add(deepof.model_utils.Entropy_regulariser(1.0))
test_model.compile(
loss=tf.keras.losses.binary_crossentropy,
......
......@@ -117,8 +117,8 @@ def test_autoencoder_fitting(
phenotype_class=pheno_class,
predictor=predictor,
variational=variational,
knn_neighbors=10,
knn_samples=10,
entropy_neighbors=0.75,
entropy_samples=10,
)
......@@ -170,8 +170,8 @@ def test_tune_search(
cp=False,
reg_cat_clusters=True,
reg_cluster_variance=True,
knn_neighbors=10,
knn_samples=10,
entropy_radius=0.75,
entropy_samples=10,
logparam=None,
)
)[1:]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment