Code Monkey home page Code Monkey logo

ast-brazilian-lora's Introduction

Audio Spectrogram Transformer with LoRA

-Introduction

-Getting Starting

-Citation

-Contact

Introduction

This repository hosts an implementation of the Audio Spectrogram Transformer (AST) based on the official implementation provided by the authors of the paper "Parameter-Efficient Transfer Learning of Audio Spectrogram Transformers" -- PETL_AST. The paper introduces Parameter-Efficient Transfer Learning (PETL) methods tailored to the Audio Spectrogram Transformer architecture. In this repository, particular emphasis is placed on the LoRA (Low Rank) adapter, which has demonstrated the best results.

After all, what is LoRA?

Low Rank Adaption is the most widely used PETL methods. Provides the approach to fine-tuning a model for downstream tasks and the capability of transfer learning with fewer resources.

Context

-- Neural networks use dense layers with weight matrices for computation --These weight matrices are typically "full-rank"(use all dimensions)

Solution

-- The pre-trained models have a low "intrisic dimension" meaning they might not need full-rank weight matrices.
-- The pre-trained parameters of the original model (W) are frozen. These weights (W) will not be modified
-- A new set of parameters is added to the network WA and WB ( low-rank weight vectors) where the dimensions are represented as dxr and rxd ( r - low rank dimension; d - original dimension)

Module AST

Getting Starting

Step 1. Clone or download this repository and set it as the working directory, create a virtual environment and install the dependencies.

cd ast-lora/ 
python3 -m venv venvast
source venvast/bin/activate
pip install -r requirements.txt 

Step 2: Running Experiment

We just need set some parameters in train.yaml:

  • ``` lr_LoRA ```
  • ``` weight_decay ```
  • ``` final_output ```
  • ``` patch_size ```
  • ``` hidden_size ```

In main.sh just need set data path ( train, validation and test ) and some parameters.

bash  main.sh

Citation

Citing the original paper:

@misc{cappellazzo2024efficient,
      title={Efficient Fine-tuning of Audio Spectrogram Transformers via Soft Mixture of Adapters}, 
      author={Umberto Cappellazzo and Daniele Falavigna and Alessio Brutti},
      year={2024},
      eprint={2402.00828},
      archivePrefix={arXiv},
      primaryClass={eess.AS}
}

Contact

If you have a question, or just want to share how you have use this, send me an email at [email protected]

ast-brazilian-lora's People

Contributors

umbertocappellazzo avatar aryamtos 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.