GuitarLSTM icon indicating copy to clipboard operation
GuitarLSTM copied to clipboard

Prepare data with tensorflow?

Open mishushakov opened this issue 4 years ago • 2 comments

currently numpy is used for preparing data in predict.py (and other places) it would makes sense to switch to corresponding methods in tensorflow

primary motivation would be better performance (source) and secondary, to have same preparation pipeline on every platform tensorflow supports, compared to numpy, which is only available in python

mishushakov avatar Dec 06 '20 22:12 mishushakov

in my case particularly i have a problem translating some functions to javascript for example take a look at this

https://github.com/GuitarML/GuitarLSTM/blob/3c1dc9e379241c0f43369f2e60e88ffa0653df94/predict.py#L57

as far as i understand you're adding two arrays of different shapes by adding another dimension to one of them i'm in a big trouble now, 'cause i'm too dumb to reimplement the math myself and existing solutions don't work

having the task implemented in tensorflow would allow me to use your code as reference and reimplement the process using the very same methods available via TensorFlow.js API

mishushakov avatar Dec 06 '20 22:12 mishushakov

@mishushakov I'm for that, I'll look into making it all tensorflow operations. Yes, when preparing the input data, each output audio sample depends on the previous "input_size" number of samples. So it's building an array of (numSamples, input_size,). For an input size of 100, 99% of the data is redundant, so I'm also interested in a more clever way of handling the preprocessing so that the RAM doesn't blow up.

GuitarML avatar Dec 08 '20 12:12 GuitarML