Skip to main content

Interface module for Self-supervised Speech Models

Project description

Interface Design for Self-Supervised Speech Models


LICENSE STAR ISSUE PR

Links: arXiv

Interface module for Self-supervised Speech Models

Install

  1. First clone the repo
    git clone git@github.com:atosystem/SSL_Interface.git
    
  2. install the repo
    cd SSL_Interface
    pip install -e .
    

Usage

import torch
import SSL_Interface
import SSL_Interface.configs
import SSL_Interface.interfaces


WS_Interface = SSL_Interface.interfaces.WeightSumInterface(
    SSL_Interface.configs.WeightedSumInterfaceConfig(
        upstream_feat_dim=768,
        upstream_layer_num=13,
        normalize=False,
    )
)

HConv_Interface = SSL_Interface.interfaces.HierarchicalConvInterface(
    SSL_Interface.configs.HierarchicalConvInterfaceConfig(
        upstream_feat_dim=768,
        upstream_layer_num=13,
        normalize=False,
        conv_kernel_size=5,
        conv_kernel_stride=3,
        output_dim=768
    )
)



layer, batch_size, seq_len, hidden_size = 13,8,100,768

feats = torch.randn(layer, batch_size, seq_len, hidden_size)

feats = feats.cuda()
WS_Interface = WS_Interface.cuda()
HConv_Interface = HConv_Interface.cuda()

out = WS_Interface(feats)
print(out.shape)
# torch.Size([8, 100, 768])

out = HConv_Interface(feats)
print(out.shape)
# torch.Size([8, 100, 768])

Reference Repositories

s3prl

Citation

@article{shih_interface_2024,
  title={Interface Design for Self-Supervised Speech Models},
  author={Yi-Jen Shih and David Harwath},
  journal={Interspeech},
  year={2024},
  publisher={IEEE}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ssl_interface-0.1.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

SSL_Interface-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file ssl_interface-0.1.0.tar.gz.

File metadata

  • Download URL: ssl_interface-0.1.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for ssl_interface-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bd8a894a6dd96a3f8a0631f7469e2a7779a63ba39ffc768275cd7bd1fc843ff2
MD5 42065a5fddb35289b7b2bd132809776b
BLAKE2b-256 9d9bf48019943590c4ce98f7af37126c4ac639c2e984400ca19b384552c9ee6f

See more details on using hashes here.

File details

Details for the file SSL_Interface-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: SSL_Interface-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for SSL_Interface-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 172f2744d2887c54ed87d0f73fba20bd963b4cfadd2f288c6943b42648ba67cb
MD5 2a619e1ddf2ad92257ea4f17ae4ba59b
BLAKE2b-256 05852e35377c80e7e225867826a8c810b457213f486ba8ada2da5e8a6fd8bfa9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page