Skip to content

Commit

Permalink
inline if
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthakpati committed Jun 15, 2023
1 parent bcc2d9b commit 408fd37
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions GANDLF/utils/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,7 @@ def get_class_imbalance_weights(training_df, params):
"training_data_hash", hash_pandas_object(training_df).sum()
)
# compare the previous and current training data hashes, and reset the weights if the training data has changed
if previous_training_hash != current_training_data_hash:
penalty_weights, class_weights = None, None
penalty_weights = None if previous_training_hash != current_training_data_hash else penalty_weights

if penalty_weights is None or class_weights is None:
print("Calculating weights")
Expand Down

0 comments on commit 408fd37

Please sign in to comment.