Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare data with tensorflow? #5

Open
mishushakov opened this issue Dec 6, 2020 · 2 comments
Open

Prepare data with tensorflow? #5

mishushakov opened this issue Dec 6, 2020 · 2 comments

Comments

@mishushakov
Copy link
Contributor

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 mishushakov changed the title Prepare data using tensorflow? Prepare data with tensorflow? Dec 6, 2020
@mishushakov
Copy link
Contributor Author

mishushakov commented Dec 6, 2020

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

indices = np.arange(input_size) + np.arange(len(X)-input_size+1)[:,np.newaxis]

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

@GuitarML
Copy link
Owner

GuitarML commented Dec 8, 2020

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants