Faur/TIMIT

debug prints

Opened this issue · 3 comments

Hi there,
I'm trying to use your code, it seems quite nice.
The preprocessing works well, but when run RNN.py with DEBUG enabled, the program crashes with 'X' is not defined' errors.
It crashes here:

l_in = L.InputLayer(shape=(batch_size, None, num_features))
        #l_in = L.InputLayer(shape=(None, None, num_features))      #compile for variable batch size; slower
        # (batch_size, max_time_steps, n_features_1, n_features_2, ...)
        # Only stochastic gradient descent
        if debug:
            get_l_in = theano.function([l_in.input_var], L.get_output(l_in))
            l_in_val = get_l_in(self.X)
            print(get_l_in)
            print(l_in_val)
            print('output size: ', end='\t');
            print(self.Y.shape)
            print('input size:', end='\t');
            print(self.X[0].shape)
            print('l_in size:', end='\t');
            print(l_in_val.shape)

What is the X supposed to be? I would guess it's a single input vector, not the whole dataset, right?
If I give it just the first element of the test set X_test[0], I get an error:
TypeError: ('Bad input argument to theano function with name "src/RNN_tools.py:68" at index 0(0-based)', 'Wrong number of dimensions: expected 3, got 2 with shape (364, 26).')
I don't really understand what I should pass as 'X', could you explain that?

Faur commented

Hi. Thank you for your interest. It is a while since I actually worked on this project, but I will try and do my best to help if you haven't solved this or moved on (sorry for the late answer).

I believe that the code expects that 'X' is a list with only one input vector (i.e. [X], where X is one input vector). This doesn't make a lot of sense, and is basically documented nowhere, sorry :) I hope this helps, otherwise get back to me.

If you continue to work on this then the correct solution is (probably) to use a mask, and then allow for multiple samples per batch. This was what I was going for (thus the mess), but never got it working, and never cleaned up fully.

Hi,
I got it working in the end, also with the masks and batched training.
I made a lot of modifications and extensions; you can find my code here: https://github.com/matthijsvk/multimodalSR/tree/master/code/audioSR

Faur commented

Glad to hear you got it working. I had a quick look at your project, and it looks cool.