This little script eases building, running, testing and analyzing Android apps with [ant][2] and [adb][1].
You may also see it as interactive dictionary of useful [adb commands][1].
import mmap | |
import torch | |
import json | |
import os | |
from huggingface_hub import hf_hub_download | |
def load_file(filename, device): | |
with open(filename, mode="r", encoding="utf8") as file_obj: | |
with mmap.mmap(file_obj.fileno(), length=0, access=mmap.ACCESS_READ) as m: |
# CTC vanilla and CTC via crossentropy are equal, and their gradients as well. In this reformulation it's easier to experiment with modifications of CTC. | |
# References on CTC regularization: | |
# "A Novel Re-weighting Method for Connectionist Temporal Classification", Li et al, https://arxiv.org/abs/1904.10619 | |
# "Focal CTC Loss for Chinese Optical Character Recognition on Unbalanced Datasets", Feng et al, https://www.hindawi.com/journals/complexity/2019/9345861/ | |
# "Improved training for online end-to-end speech recognition systems", Kim et al, https://arxiv.org/abs/1711.02212 | |
import torch | |
import torch.nn.functional as F | |
## generate example data |
#EXTM3U | |
#EXTINF:0,France Culture - direct | |
http://direct.franceculture.fr/live/franceculture-midfi.mp3 | |
#EXTINF:0,France Inter | |
http://icecast.radiofrance.fr/franceinter-hifi.aac?id=radiofrance | |
#EXTINF:0,France Musique | |
http://direct.francemusique.fr/live/francemusique-midfi.mp3 | |
#EXTINF:0,France Info | |
https://stream.radiofrance.fr/franceinfo/franceinfo_hifi.m3u8 | |
#EXTINF:0,France Culture - alternative link |