Giter VIP home page Giter VIP logo

audiossl's Introduction

Audio Self Supervised Learning

Audiossl is developed as we implement our own audio self-supervised learning methods(see Methods below). This library provides general modules involved in audio pretraining, such as dataset loading, data transformation and etc.

Methods


Two official implemented audio self-supervised methods are included:

  1. ATST: Audio Representation Learning with Teacher-Student Transformer (Published at (INTERSPEECH2022))

    See audiossl/methods/atst

  2. Self-supervised Audio Teacher-Student Transformer for Both Clip-level and Frame-level Tasks (Accepted by TASLP)

    See audiossl/methods/atstframe

Install


  1. install pytorch ( version 1.12.1 or higher )
conda install pytorch=1.12.1 torchvision torchaudio cudatoolkit=11.3 -c pytorch -c nvidia   

  1. install audiossl
    git clone https://github.com/Audio-WestlakeU/audiossl
    cd audiossl
    pip install .

Datasets


One of the difficult parts of doing research on audio self-supervised learning is that you need to evaluate pretrained model on diverse downstream datasets. Audiossl implements an unified dataset interface to make evaluation easier. It's also easy to implement a new dataset.

  1. List available datasets

    from audiossl import datasets
    print(datasets.list_all_datasets())
    """ output:
    voxceleb1:
    { 'creator': <function create_voxceleb1 at 0x7fbe285d0f80>,
    'multi_label': False,
    'num_folds': 1,
    'num_labels': 1251}
    us8k:
    { 'creator': <function create_us8k at 0x7fbe285d6170>,
    'multi_label': False,
    'num_folds': 10,
    'num_labels': 10}
    nsynth:
    { 'creator': <function create_nsynth at 0x7fbe285d60e0>,
    'multi_label': False,
    'num_folds': 1,
    'num_labels': 11}
    spcv2:
    { 'creator': <function create_spcv2 at 0x7fbe285d64d0>,
    'multi_label': False,
    'num_folds': 1,
    'num_labels': 35}
    audioset_b:
    { 'creator': <function create_spcv2 at 0x7fbe285d6560>,
    'multi_label': True,
    'num_folds': 1,
    'num_labels': 527}
    audioset:
    { 'creator': <function create_spcv2 at 0x7fbe285d65f0>,
    'multi_label': True,
    'num_folds': 1,
    'num_labels': 527}
    """
  2. Use a dataset

    • Data preparation

      See audiossl/methods/atst/docs/data_prep.md

    • Get a dataset

      from audiossl import datasets
      dsinfo=dataset.get_dataset("nsynth")
      ds = dsinfo.creat_fn(PATH_DATASET,split="train",transform=None,target_transform=None)
  3. Transformations

    See audiossl.transforms.

  4. An easy-to-use lightning data module

    from audiossl.lightning.datamodules import DownstreamDataModule
    data_module = DownStreamDataModule(data_path,
                                      dataset_name,
                                      batch_size=512
                                      transforms=[train_transform,
                                                  valid_transform,
                                                  test_transform],
                                                  )
                                      target_transforms=[train_targe_transform,
                                                        None,
                                                        None])

audiossl's People

Contributors

lmaxwell avatar saoyear avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.