Skip to content

Commit

Permalink
the weight calculated internally must be float32
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyangkang committed Nov 11, 2024
1 parent 5cb4f54 commit 1e2ba6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stemflow/model/static_func_AdaSTEM.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def train_one_stixel(
if (not task == "regression") and sample_weights_for_classifier:
sample_weights = class_weight.compute_sample_weight(
class_weight="balanced", y=np.where(sub_y_train > 0, 1, 0)
)
).astype('float32')
trained_model.fit(sub_X_train[stixel_specific_x_names], sub_y_train, sample_weight=sample_weights)

# try:
Expand Down

0 comments on commit 1e2ba6e

Please sign in to comment.