Skip to content

Instantly share code, notes, and snippets.

View zh794390558's full-sized avatar

Hui Zhang zh794390558

  • baidu
  • beijing
View GitHub Profile
@leimao
leimao / mm.cu
Last active October 25, 2023 04:25
Matrix Multiplication and Batched Matrix Multiplication Implementations Using C++ and CUDA.
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <iomanip>
#include <iostream>
#include <random>
#include <stdexcept>
#include <vector>
#define BLOCK_DIM 32
@tarlen5
tarlen5 / calculate_mean_ap.py
Last active September 17, 2024 07:44
Calculate mean Average Precision (mAP) for a set of ground truth and predicted bounding boxes for a set of images.
"""
author: Timothy C. Arlen
date: 28 Feb 2018
Calculate Mean Average Precision (mAP) for a set of bounding boxes corresponding to specific
image Ids. Usage:
> python calculate_mean_ap.py
Will display a plot of precision vs recall curves at 10 distinct IoU thresholds as well as output
@carlthome
carlthome / tfcompile.ipynb
Last active October 11, 2022 16:14
Example of how to use XLA AOT via tfcompile to build a Keras model into a shared library.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@candlewill
candlewill / 1_Ossian初探.md
Last active July 12, 2021 05:05
Chinese TTS based on Ossian

Ossian初探

本文先完全按照官方教程跑通一个合成流程,然后尝试在中文上进行合成。

安装

虽然官方提供了一键安装方法:./scripts/setup_tools.sh $HTK_USERNAME $HTK_PASSWORD,但在我们的尝试中,未能成功。

以下是Debug过程

直接运行出现的错误为:

@awni
awni / ctc_decoder.py
Last active September 18, 2024 11:44
Example CTC Decoder in Python
"""
Author: Awni Hannun
This is an example CTC decoder written in Python. The code is
intended to be a simple example and is not designed to be
especially efficient.
The algorithm is a prefix beam search for a model trained
with the CTC loss function.

Merlin for Chinese

用于中文语音合成的Merlin。本文,主要利用Merlin,合成中文语音。

数据准备

为了测试方法是否可行,我们仅使用100条数据。待确认可行,再使用完整数据。

由于缺少中文前端,我们仅使用音素。

@candlewill
candlewill / extract_features_for_merlin.md
Last active November 2, 2022 08:34
Analysis the source code of merlin

声学特征提取

本文介绍如何提取提取声学特征用于Merlin训练。在语音合成中,属于声码器(vocoder)的内容。

Merlin可以使用两种vocoder,STRAIGHTWORLDWORLD的目标是提取60-dim MGC, variable-dim BAP (BAP dim: 1 for 16Khz, 5 for 48Khz), 1-dim LF0;STRAIGHT的目标是提取60-dim MGC, 25-dim BAP, 1-dim LF0。

新版本的WORLD_v2还在开发中,目标是提取60-dim MGC, 5-dim BAP, 1-dim LF0(MGC和BAP的维度支持微调)。

由于STRAIGHT的使用有严格的证书限制,本文,主要介绍WORLD

@MInner
MInner / top_k_seq2seq.py
Last active October 25, 2017 02:46
This snipped extracts top k beams from the beam search output of github.com/google/seq2seq.
# based on https://github.com/google/seq2seq/blob/master/bin/tools/generate_beam_viz.py
# extracts probabilities and sequences from .npz file generated during beam search.
# and pickles a list of the length n_samples that has beam_width most probable tuples
# (path, logprob, prob)
# where probs are scaled to 1.
import numpy as np
import networkx as nx
import pickle
@richtr
richtr / config.yml
Last active November 28, 2017 21:36
Parse YAML from bash with sed and awk.
development:
adapter: mysql2
encoding: utf8
database: my_database
username: root
password:
apt:
- somepackage
- anotherpackage
@gocarlos
gocarlos / Eigen Cheat sheet
Last active September 10, 2024 02:31
Cheat sheet for the linear algebra library Eigen: http://eigen.tuxfamily.org/
// A simple quickref for Eigen. Add anything that's missing.
// Main author: Keir Mierle
#include <Eigen/Dense>
Matrix<double, 3, 3> A; // Fixed rows and cols. Same as Matrix3d.
Matrix<double, 3, Dynamic> B; // Fixed rows, dynamic cols.
Matrix<double, Dynamic, Dynamic> C; // Full dynamic. Same as MatrixXd.
Matrix<double, 3, 3, RowMajor> E; // Row major; default is column-major.
Matrix3f P, Q, R; // 3x3 float matrix.