This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
DyNet implementation of a sequence labeler (POS taggger). | |
This is a translation of this tagger in PyTorch: https://gist.github.com/hal3/8c170c4400576eb8d0a8bd94ab231232 | |
Basic architecture: | |
- take words | |
- run though bidirectional GRU | |
- predict labels one word at a time (left to right), using a recurrent neural network "decoder" | |
The decoder updates hidden state based on: | |
- most recent word |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(caret) | |
## select training indices preserving class distribution | |
in.train <- createDataPartition(yclass, p=0.8, list=FALSE) | |
summary(factor(yclass)) | |
ytra <- yclass[in.train]; summary(factor(ytra)) | |
ytst <- yclass[-in.train]; summary(factor(ytst)) | |
## standardize features: training parameters of scaling for test-part | |
Xtra <- scale(X[in.train,]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Credit http://stackoverflow.com/a/2514279 | |
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r |