Skip to content

Commit

Permalink
clean up imports
Browse files Browse the repository at this point in the history
  • Loading branch information
sammlapp committed Sep 10, 2024
1 parent 6f6198e commit 52f7d76
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions opensoundscape/ml/cnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 52f7d76

Please sign in to comment.