Clemens-Alexander Brust 4 rokov pred
rodič
commit
111cffab69
1 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 2 2
      chillax/methods/sample_weight_by_ic.py

+ 2 - 2
chillax/methods/sample_weight_by_ic.py

@@ -97,10 +97,10 @@ class SampleWeightByICSampleTransfomer(SampleTransformer, instrumentation.Observ
 
         # Apply softmax
         sample_weights = {
-            sample_uid: sample_ic_exp_tf / ic_exp_tf_sum
+            sample_uid: (sample_ic_exp_tf * len(samples)) / ic_exp_tf_sum
             for sample_uid, sample_ic_exp_tf in sample_ics_exp_tf.items()
         }
-        sample_weight_array = np.asarray(list(sample_weights.values())) * len(samples)
+        sample_weight_array = np.asarray(list(sample_weights.values()))
         self.log_info(
             f"Weight*cnt mean {np.mean(sample_weight_array)}, std {np.std(sample_weight_array)}, median {np.median(sample_weight_array)}"
         )