Skip to content

Instantly share code, notes, and snippets.

View AppleHolic's full-sized avatar
🎯
Voice, Deep Learning

ILJI CHOI AppleHolic

🎯
Voice, Deep Learning
View GitHub Profile
@AppleHolic
AppleHolic / common.py
Last active July 18, 2017 07:19
Text Classification Training Code (mxnet)
import mxnet as mx
import numpy as np
# make and return data iterator
def get_data_iter(data, tags, labels, shuffle=False, batch_size=64):
nditer = mx.io.NDArrayIter(data={'data' : data, 'tags' : tags}, label={'labels': labels}, batch_size=batch_size, shuffle=shuffle)
return nditer
# origins (precision recall functions)
'''
@AppleHolic
AppleHolic / calc_deconv_dims.py
Created October 30, 2018 12:20
calculate convolution dimensions
x = 80 # spectrogram scale
output = 24000 # waveform scale
max_f = 50
max_s = 50
N = 2
# calculate function
calc_conv_dim = lambda x, f, s, p: (x - f + p) // s + 1
calc_deconv_dim = lambda x, f, s, p: int((x - 1) * s - p + f)
@AppleHolic
AppleHolic / wav_encoder.js
Created December 3, 2020 09:48
Wave file writing codes in several language (javascript, kotlin, +python)
export default class {
constructor (options) {
this.bufferSize = options.bufferSize || 4096
this.sampleRate = options.sampleRate
this.samples = options.samples
}
getData () {
this._joinSamples()