keunwoochoi / music-auto_tagging-keras

Music auto-tagging models and trained weights in keras/theano
MIT License
616 stars 142 forks source link

Please provide crnn training example #34

Closed Vital95 closed 6 years ago

Vital95 commented 6 years ago

Hi Keunwoo! Thank you for this repo! But can you please provide a code chunks for model training? Number of epochs, batch size and number of samples, etc... I would like to train my own model with this dataset: https://github.com/mdeff/fma

For now I have created a custom generator but maybe you can point out few hints. Thank you.

def MelGenerator(features, labels, batch_size):
 # Create empty arrays to contain batch of features and labels#
    batch_features = np.zeros((batch_size, 96, 1366, 1))
    batch_labels = np.zeros((batch_size,1))
    while True:
        for i in range(batch_size):
        # choose random index in features
            index = randint(0, np.size(batch_features,0))
            batch_features[i] = features[index]
            batch_labels[i] = labels[index]
        yield batch_features, batch_labels
keunwoochoi commented 6 years ago

Hi, training part would more depend on the dataset, or rather be general regardless of the task. I don't think there' a particular problem in your generator. Batch size was approx 16-32. Other details are in my paper which is linked in the README. FMA is good and large enough, I think you'd get some nice results with it.

Vital95 commented 6 years ago

ok, thank you for information!