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

Training an RNN to classify sequences using just the last LSTM output #325

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Training an RNN to classify sequences using just the last LSTM output #325

wants to merge 7 commits into from

Conversation

aodhan-domhnaill
Copy link

@aodhan-domhnaill aodhan-domhnaill commented Oct 29, 2017

I did this as a demo for a particular project. I can polish it up if you want it.

You basically just run an LSTM on every sequence, take the last output for each sequence and the push that through a neural net.

There are 2 demos training on generated data and then one classifying sentences as Spanish or English. The language one is tested using entirely different novels.

@zackchase
Copy link
Owner

Hi aidan - just got back to town after a couple weeks abroad plus some insane paper deadline - looking forward to reviewing this properly. Thanks for the PR!

Copy link

@ChaiBapchya ChaiBapchya left a comment

Choose a reason for hiding this comment

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

What kind of loss is being used here -loss = nd.mean((out[out.shape[0]-1] - 2)**2)
? Would be great to mention that.

Copy link

@ChaiBapchya ChaiBapchya left a comment

Choose a reason for hiding this comment

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

LGTM for the most part. Minor comments!

" if len(s) > min_len and len(s) < max_len:\n",
" yield s\n",
" \n",
" # Run through all the novels and grab all the sentences in the books and grab all the sentences\n",
Copy link

Choose a reason for hiding this comment

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

What do you mean here? @aidan-plenert-macdonald

Copy link
Author

Choose a reason for hiding this comment

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

Just sentences out as series of characters

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

3 participants