From 52f7d7677dfa510a143c7738e000d3391106b31c Mon Sep 17 00:00:00 2001 From: sammlapp Date: Tue, 10 Sep 2024 15:45:23 -0400 Subject: [PATCH] clean up imports --- opensoundscape/ml/cnn.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/opensoundscape/ml/cnn.py b/opensoundscape/ml/cnn.py index e6a6d006..fdcd42b2 100644 --- a/opensoundscape/ml/cnn.py +++ b/opensoundscape/ml/cnn.py @@ -27,15 +27,13 @@ from opensoundscape.preprocess import io from opensoundscape.ml.datasets import AudioFileDataset from opensoundscape.ml.cnn_architectures import inception_v3 -from opensoundscape.ml.loss import ResampleLoss -from opensoundscape.sample import collate_audio_samples, collate_audio_samples_to_dict -from opensoundscape.utils import identity, _check_is_path +from opensoundscape.sample import collate_audio_samples +from opensoundscape.utils import identity from opensoundscape.logging import wandb_table from opensoundscape.ml.cam import CAM import pytorch_grad_cam from pytorch_grad_cam.utils.model_targets import ClassifierOutputTarget -from lightning.pytorch.callbacks import ModelCheckpoint from torchmetrics.classification import ( @@ -2189,9 +2187,7 @@ class BaseClassifier(SpectrogramClassifier): """ -def use_resample_loss( - model, train_df -): # TODO revisit how this work. Should be able to set loss_cls=ResampleLoss() +def use_resample_loss(model, train_df): """Modify a model to use ResampleLoss for multi-target training ResampleLoss may perform better than BCE Loss for multitarget problems