This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class { | |
constructor (options) { | |
this.bufferSize = options.bufferSize || 4096 | |
this.sampleRate = options.sampleRate | |
this.samples = options.samples | |
} | |
getData () { | |
this._joinSamples() |