alireza-nasiri / soundclr Goto Github PK
View Code? Open in Web Editor NEWImplementation for "SoundCLR: Contrastive Learning of Representations For Improved Environmental Sound Classification," in pytorch.
License: MIT License
Implementation for "SoundCLR: Contrastive Learning of Representations For Improved Environmental Sound Classification," in pytorch.
License: MIT License
def cross_entropy_one_hot(input, target):
_, labels = target.max(dim=1)
return nn.CrossEntropyLoss(weight=class_weights)(input, labels).
What is weight=class_weights for different datasets
The results on US8K with Cross-Entropy Loss is 86.16, but I am getting 78.01. I am training with these specifications:
BASELINE
transfer - augmentation on both waves and specs - 3 channels
US8K
train folds are [2, 3, 4, 5, 6, 7, 8, 9, 10] and test fold is [1]
number of freq masks are 2 and their max length is 32
number of time masks are 1 and their max length is 32
@alireza-nasiri
Hello,
Sorry to disturb you again, I would like to ask if your code can be used on other data sets? (I am very sorry to tell you that my code level is limited, and I have not understood part of your code.) I understand that your data set is converted into a spectrogram for operation. I also have a processed spectrogram here. Form of data set. So what should I do next to run successfully? I would be very grateful if you could put forward some suggestions and methods.
Hello @alireza-nasiri ,
Thank you for sharing such excellent code .
May I ask you a question?
‘ModuleNotFoundError: No module named 'sgmllib'’ error when I run code,Looking up the information, we know that the package above python3 is gone,How to solve this problem?
I got a question. You specify dim=0 for every F.normalize(). Is it normalizing along with the batch size axis? The shape of y_rep
is B x 2048
. If you want to normalize each embedding on a unit hypersphere, should it be through dim=1?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.