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

Reorganisation Fixes #120

Merged
merged 12 commits into from
Aug 21, 2019

Conversation

pushkalkatara
Copy link
Contributor

Checked all examples and fixed a few issues.

"y_train shape is: (6294, 6, 6)\n",
"x_test shape is: (1058, 6, 48, 9)\n",
"y_test shape is: (1058, 6, 6)\n"
"x_train shape is: (6409, 6, 48, 9)\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pushkalkatara Why did the x_train shape change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@harsha-simhadri Due to data generation script, the shapes on each processing is varying. i.e

Processing data
Extracting features
('subinstanceLen', 48)
('subinstanceStride', 16)
('sourceDir', '/home/pushkalkatara/mr/EdgeML/examples/tf/EMI-RNN/HAR//RAW/')
('outDir', '/home/pushkalkatara/mr/EdgeML/examples/tf/EMI-RNN/HAR//48_16/')
Num train 6339
Num test 2947
Num val 1013
Done
Processing data
Extracting features
('subinstanceLen', 48)
('subinstanceStride', 16)
('sourceDir', '/home/pushkalkatara/mr/EdgeML/examples/tf/EMI-RNN/HAR//RAW/')
('outDir', '/home/pushkalkatara/mr/EdgeML/examples/tf/EMI-RNN/HAR//48_16/')
x_train 6335
Num train 6335
Num test 2947
Num val 1017
Done

@adityakusupati
Copy link
Contributor

adityakusupati commented Aug 19, 2019 via email

Copy link
Contributor

@adityakusupati adityakusupati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pushkalkatara can we add two more num params. One for the biases and one for scalars.
num_biases, num_scalars

@pushkalkatara
Copy link
Contributor Author

@pushkalkatara can we add two more num params. One for the biases and one for scalars.
num_biases, num_scalars

@adityakusupati Where should I add the num params?

@@ -70,16 +70,16 @@ def __init__(self, input_size, hidden_size,
self._hidden_size = hidden_size
self._gate_nonlinearity = gate_nonlinearity
self._update_nonlinearity = update_nonlinearity
#self._num_weight_matrices = num_weight_matrices
#self._num_weight_matrices = [1,1]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it better to set it to None, as opposed to [1,1]? @adityakusupati

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@harsha-simhadri that line has been commented out, but it should be None.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pushkalkatara should be part of the base RNN class hence we need to assign None here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll commit the change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pushkalkatara I made some suggestion in a new review please do those change and I will do a comprehensive review today.

edgeml_pytorch/graph/rnn.py Outdated Show resolved Hide resolved
edgeml_pytorch/graph/rnn.py Show resolved Hide resolved
edgeml_pytorch/graph/rnn.py Outdated Show resolved Hide resolved
@adityakusupati
Copy link
Contributor

@pushkalkatara can we add two more num params. One for the biases and one for scalars.
num_biases, num_scalars

@adityakusupati Where should I add the num params?

@pushkalkatara
Ignore these two comments. Please check the review I made #120 (review)

@pushkalkatara
Copy link
Contributor Author

@harsha-simhadri @adityakusupati I am not able to test SRNN as the script process_google.py gives out MemoryError while preparing the dataset.

Traceback (most recent call last):
  File "process_google.py", line 257, in <module>
    numFilt, samplerate, winlen, winstep)
  File "process_google.py", line 173, in extractFeatures
    allSamples = np.zeros((len(fileList), maxlen))
MemoryError

Most probably enough memory is not available on my system to generate the maxlen size zeros numpy array.
We can port the TensorFlow version of EMIRNN to PyTorch to test the implementation of rnn.py. Is the example required in PyTorch?

edgeml_pytorch/graph/rnn.py Outdated Show resolved Hide resolved
if uRank is not None:
self._num_U_matrices += 1
self._num_weight_matrices[1] = self._num_U_matrices
if uRank and wRank:
self._num_biases += 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pushkalkatara num_biases is independent on uRank and wRank but rather dependent on the bias parameters which look like self.bias_*. Please update this accordingly. For FastGRNN it will be 2 bias terms, FastRNN has 1, UGRNN as 2, GRU has 3 and LSTM has 4, simple RNN has 1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please check getVars() function to see what we are trying to do with this num_biases. This counting list is a easy way to access getVars()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I just noticed it. I'll make the changes accordingly.

edgeml_pytorch/graph/rnn.py Outdated Show resolved Hide resolved
@@ -70,16 +70,16 @@ def __init__(self, input_size, hidden_size,
self._hidden_size = hidden_size
self._gate_nonlinearity = gate_nonlinearity
self._update_nonlinearity = update_nonlinearity
#self._num_weight_matrices = num_weight_matrices
#self._num_weight_matrices = [1,1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pushkalkatara I made some suggestion in a new review please do those change and I will do a comprehensive review today.

Copy link
Contributor

@adityakusupati adityakusupati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please fix the rest of the cells as well. Thanks.

@pushkalkatara
Copy link
Contributor Author

Can you please fix the rest of the cells as well. Thanks.

All others have the correct num_biases in the constructor.

@harsha-simhadri
Copy link
Collaborator

@harsha-simhadri @adityakusupati I am not able to test SRNN as the script process_google.py gives out MemoryError while preparing the dataset.

Traceback (most recent call last):
  File "process_google.py", line 257, in <module>
    numFilt, samplerate, winlen, winstep)
  File "process_google.py", line 173, in extractFeatures
    allSamples = np.zeros((len(fileList), maxlen))
MemoryError

Most probably enough memory is not available on my system to generate the maxlen size zeros numpy array.
We can port the TensorFlow version of EMIRNN to PyTorch to test the implementation of rnn.py. Is the example required in PyTorch?

Lets hold off on porting EMIRNN to PyTorch just yet. @metastableB Any clue what might be going wrong here?

@metastableB
Copy link
Contributor

@harsha-simhadri @pushkalkatara Yes lets hold of on porting EMI-RNN for now. That will require a lot of care.

I'll fix the process_google.py to work out of disk rather than out of RAM today. That should fix the RAM issues. @pushkalkatara thanks for pointing this out.

@SachinG007
Copy link
Contributor

SachinG007 commented Aug 20, 2019

While testing fastcell_example.py

    if cell == "FastGRNN":
        FastCell = FastGRNNCell(inputDims, hiddenDims,
                                gate_non_linearity=gate_non_linearity,
                                update_non_linearity=update_non_linearity,
                                wRank=wRank, uRank=uRank)

unexpected keyword gate_non_linearity
In the function definitions, the key is gate_nonLinearity
(same issue with all other cell Types)
@adityakusupati

@pushkalkatara
Copy link
Contributor Author

@SachinG007 The fix is in the commit 08a3826 in this PR

@adityakusupati
Copy link
Contributor

@harsha-simhadri this PR looks good to me in the context of Bonsai and FastCells. Please, approve. @pushkalkatara thanks for your contributions.

@pushkalkatara pushkalkatara changed the title Reoraganisation Fixes Reorganisation Fixes Aug 20, 2019
@harsha-simhadri
Copy link
Collaborator

@harsha-simhadri @pushkalkatara Yes lets hold of on porting EMI-RNN for now. That will require a lot of care.

I'll fix the process_google.py to work out of disk rather than out of RAM today. That should fix the RAM issues. @pushkalkatara thanks for pointing this out.

@metastableB Should we wait for your fix or go ahead with PR?

@harsha-simhadri
Copy link
Collaborator

process_google.py needs to be fixed while working with small memory. But lets do another PR for that. Lets just go ahead now

@harsha-simhadri harsha-simhadri merged commit 40663ca into microsoft:harsha/reorg Aug 21, 2019
@pushkalkatara
Copy link
Contributor Author

Thanks for the merge.

@pushkalkatara pushkalkatara deleted the harsha/reorg branch August 21, 2019 13:12
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

Successfully merging this pull request may close these issues.

None yet

5 participants