keunwoochoi / kapre

kapre: Keras Audio Preprocessors
MIT License
922 stars 146 forks source link

Melspectrogram - How to modify this paragraph in the latest edition of Kapre #82

Closed Deep-learning999 closed 4 years ago

Deep-learning999 commented 4 years ago

model = Sequential() model.add(Melspectrogram(sr=SR, n_mels=128, n_dft=512, n_hop=128, input_shape=input_shape, return_decibel_melgram=True, trainable_kernel=False, name='melgram',trainable_fb=False)) for layer in model.layers:

keunwoochoi commented 4 years ago
import kapre

melspectrogram_layer = kapre.composed.get_melspectrogram_layer(
    input_shape=input_shape,
    n_fft=512,
    hop_length=128,
    sample_rate=SR,
    n_mels=128,
)
model.add(melspectrogram_layer)