MCPcopy
hub / github.com/Audio-AGI/AudioSep / __init__

Method __init__

models/CLAP/open_clip/pann_model.py:430–497  ·  view source on GitHub ↗
(
        self,
        sample_rate,
        window_size,
        hop_size,
        mel_bins,
        fmin,
        fmax,
        classes_num,
        enable_fusion=False,
        fusion_type="None",
    )

Source from the content-addressed store, hash-verified

428
429class Cnn6(nn.Module):
430 def __init__(
431 self,
432 sample_rate,
433 window_size,
434 hop_size,
435 mel_bins,
436 fmin,
437 fmax,
438 classes_num,
439 enable_fusion=False,
440 fusion_type="None",
441 ):
442
443 super(Cnn6, self).__init__()
444
445 window = "hann"
446 center = True
447 pad_mode = "reflect"
448 ref = 1.0
449 amin = 1e-10
450 top_db = None
451
452 self.enable_fusion = enable_fusion
453 self.fusion_type = fusion_type
454
455 # Spectrogram extractor
456 self.spectrogram_extractor = Spectrogram(
457 n_fft=window_size,
458 hop_length=hop_size,
459 win_length=window_size,
460 window=window,
461 center=center,
462 pad_mode=pad_mode,
463 freeze_parameters=True,
464 )
465
466 # Logmel feature extractor
467 self.logmel_extractor = LogmelFilterBank(
468 sr=sample_rate,
469 n_fft=window_size,
470 n_mels=mel_bins,
471 fmin=fmin,
472 fmax=fmax,
473 ref=ref,
474 amin=amin,
475 top_db=top_db,
476 freeze_parameters=True,
477 )
478
479 # Spec augmenter
480 self.spec_augmenter = SpecAugmentation(
481 time_drop_width=64,
482 time_stripes_num=2,
483 freq_drop_width=8,
484 freq_stripes_num=2,
485 )
486
487 self.bn0 = nn.BatchNorm2d(64)

Callers 5

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 2

init_weightMethod · 0.95
ConvBlock5x5Class · 0.85

Tested by

no test coverage detected