Spaces:
Running
Running
minor fixes
Browse files- models/fm4m.py +14 -7
models/fm4m.py
CHANGED
@@ -308,7 +308,8 @@ def single_modal(model,dataset, downstream_model,params):
|
|
308 |
verbose=False)
|
309 |
n_samples = np.minimum(1000, len(x_batch))
|
310 |
features_umap = reducer.fit_transform(x_batch[:n_samples])
|
311 |
-
x = y_batch.values[:n_samples]
|
|
|
312 |
index_0 = [index for index in range(len(x)) if x[index] == 0]
|
313 |
index_1 = [index for index in range(len(x)) if x[index] == 1]
|
314 |
|
@@ -340,7 +341,8 @@ def single_modal(model,dataset, downstream_model,params):
|
|
340 |
reducer = umap.UMAP(metric='euclidean', n_neighbors= 10, n_components=2, low_memory=True, min_dist=0.1, verbose=False)
|
341 |
n_samples = np.minimum(1000,len(x_batch))
|
342 |
features_umap = reducer.fit_transform(x_batch[:n_samples])
|
343 |
-
x = y_batch.values[:n_samples]
|
|
|
344 |
index_0 = [index for index in range(len(x)) if x[index] == 0]
|
345 |
index_1 = [index for index in range(len(x)) if x[index] == 1]
|
346 |
|
@@ -371,7 +373,8 @@ def single_modal(model,dataset, downstream_model,params):
|
|
371 |
verbose=False)
|
372 |
n_samples = np.minimum(1000, len(x_batch))
|
373 |
features_umap = reducer.fit_transform(x_batch[:n_samples])
|
374 |
-
x = y_batch.values[:n_samples]
|
|
|
375 |
#index_0 = [index for index in range(len(x)) if x[index] == 0]
|
376 |
#index_1 = [index for index in range(len(x)) if x[index] == 1]
|
377 |
|
@@ -398,7 +401,8 @@ def single_modal(model,dataset, downstream_model,params):
|
|
398 |
verbose=False)
|
399 |
n_samples = np.minimum(1000, len(x_batch))
|
400 |
features_umap = reducer.fit_transform(x_batch[:n_samples])
|
401 |
-
x = y_batch.values[:n_samples]
|
|
|
402 |
# index_0 = [index for index in range(len(x)) if x[index] == 0]
|
403 |
# index_1 = [index for index in range(len(x)) if x[index] == 1]
|
404 |
|
@@ -426,7 +430,8 @@ def single_modal(model,dataset, downstream_model,params):
|
|
426 |
verbose=False)
|
427 |
n_samples = np.minimum(1000, len(x_batch))
|
428 |
features_umap = reducer.fit_transform(x_batch[:n_samples])
|
429 |
-
x = y_batch.values[:n_samples]
|
|
|
430 |
# index_0 = [index for index in range(len(x)) if x[index] == 0]
|
431 |
# index_1 = [index for index in range(len(x)) if x[index] == 1]
|
432 |
|
@@ -454,7 +459,8 @@ def single_modal(model,dataset, downstream_model,params):
|
|
454 |
verbose=False)
|
455 |
n_samples = np.minimum(1000, len(x_batch))
|
456 |
features_umap = reducer.fit_transform(x_batch[:n_samples])
|
457 |
-
x = y_batch.values[:n_samples]
|
|
|
458 |
# index_0 = [index for index in range(len(x)) if x[index] == 0]
|
459 |
# index_1 = [index for index in range(len(x)) if x[index] == 1]
|
460 |
|
@@ -546,7 +552,8 @@ def multi_modal(model_list,dataset, downstream_model,params):
|
|
546 |
features_umap = reducer.fit_transform(x_batch[:n_samples])
|
547 |
|
548 |
if "Classifier" in downstream_model:
|
549 |
-
x = y_batch.values[:n_samples]
|
|
|
550 |
index_0 = [index for index in range(len(x)) if x[index] == 0]
|
551 |
index_1 = [index for index in range(len(x)) if x[index] == 1]
|
552 |
|
|
|
308 |
verbose=False)
|
309 |
n_samples = np.minimum(1000, len(x_batch))
|
310 |
features_umap = reducer.fit_transform(x_batch[:n_samples])
|
311 |
+
try:x = y_batch.values[:n_samples]
|
312 |
+
except: x = y_batch[:n_samples]
|
313 |
index_0 = [index for index in range(len(x)) if x[index] == 0]
|
314 |
index_1 = [index for index in range(len(x)) if x[index] == 1]
|
315 |
|
|
|
341 |
reducer = umap.UMAP(metric='euclidean', n_neighbors= 10, n_components=2, low_memory=True, min_dist=0.1, verbose=False)
|
342 |
n_samples = np.minimum(1000,len(x_batch))
|
343 |
features_umap = reducer.fit_transform(x_batch[:n_samples])
|
344 |
+
try:x = y_batch.values[:n_samples]
|
345 |
+
except:x = y_batch[:n_samples]
|
346 |
index_0 = [index for index in range(len(x)) if x[index] == 0]
|
347 |
index_1 = [index for index in range(len(x)) if x[index] == 1]
|
348 |
|
|
|
373 |
verbose=False)
|
374 |
n_samples = np.minimum(1000, len(x_batch))
|
375 |
features_umap = reducer.fit_transform(x_batch[:n_samples])
|
376 |
+
try:x = y_batch.values[:n_samples]
|
377 |
+
except:x = y_batch[:n_samples]
|
378 |
#index_0 = [index for index in range(len(x)) if x[index] == 0]
|
379 |
#index_1 = [index for index in range(len(x)) if x[index] == 1]
|
380 |
|
|
|
401 |
verbose=False)
|
402 |
n_samples = np.minimum(1000, len(x_batch))
|
403 |
features_umap = reducer.fit_transform(x_batch[:n_samples])
|
404 |
+
try:x = y_batch.values[:n_samples]
|
405 |
+
except:x = y_batch[:n_samples]
|
406 |
# index_0 = [index for index in range(len(x)) if x[index] == 0]
|
407 |
# index_1 = [index for index in range(len(x)) if x[index] == 1]
|
408 |
|
|
|
430 |
verbose=False)
|
431 |
n_samples = np.minimum(1000, len(x_batch))
|
432 |
features_umap = reducer.fit_transform(x_batch[:n_samples])
|
433 |
+
try:x = y_batch.values[:n_samples]
|
434 |
+
except:x = y_batch[:n_samples]
|
435 |
# index_0 = [index for index in range(len(x)) if x[index] == 0]
|
436 |
# index_1 = [index for index in range(len(x)) if x[index] == 1]
|
437 |
|
|
|
459 |
verbose=False)
|
460 |
n_samples = np.minimum(1000, len(x_batch))
|
461 |
features_umap = reducer.fit_transform(x_batch[:n_samples])
|
462 |
+
try:x = y_batch.values[:n_samples]
|
463 |
+
except:x = y_batch[:n_samples]
|
464 |
# index_0 = [index for index in range(len(x)) if x[index] == 0]
|
465 |
# index_1 = [index for index in range(len(x)) if x[index] == 1]
|
466 |
|
|
|
552 |
features_umap = reducer.fit_transform(x_batch[:n_samples])
|
553 |
|
554 |
if "Classifier" in downstream_model:
|
555 |
+
try:x = y_batch.values[:n_samples]
|
556 |
+
except:x = y_batch[:n_samples]
|
557 |
index_0 = [index for index in range(len(x)) if x[index] == 0]
|
558 |
index_1 = [index for index in range(len(x)) if x[index] == 1]
|
559 |
|