suriyadeepan / rnn-from-scratch Goto Github PK
View Code? Open in Web Editor NEWUse tensorflow's tf.scan to build vanilla, GRU and LSTM RNNs
License: GNU General Public License v3.0
Use tensorflow's tf.scan to build vanilla, GRU and LSTM RNNs
License: GNU General Public License v3.0
UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9290: illegal multibyte sequence
Hi, I am following your vanilla RNN code. and I encounter an error above.
so, goggled and found the solution below.
# line 25 of data.py
def read_lines(filename):
#with open(filename) as f:
with open(filename, 'rt', encoding='UTF8') as f:
return f.read().split('\n')
Hello, thanks for making this code available. It's useful because I'm trying to create a custom, LSTM cell (with additional logic for the "forget" gate), and you've clearly coded out the internal logic of the cell.
This isn't so much an issue on the repo I'm writing about. I'm wondering if you could explain and possibly show how to adapt the model for predicting a binary outcome. Let's say the new outcome variable is made like this:
from sklearn.preprocessing import OneHotEncoder, LabelBinarizer, LabelEncoder
_, Y = make_classification(n_samples = 118929, n_classes = 2, n_features=2, n_redundant=0, n_informative=1, n_clusters_per_class=1)
label_encoder = LabelEncoder()
integer_encoded = label_encoder.fit_transform(Y)
onehot_encoder = OneHotEncoder(sparse=False)
integer_encoded = integer_encoded.reshape(len(integer_encoded), 1)
onehot_encoded = onehot_encoder.fit_transform(integer_encoded)
Y = onehot_encoded
I feel very close but I'm getting errors here: tf.nn.sparse_softmax_cross_entropy_with_logits(logits=logits, labels=ys_)
Thank you!
Thanks for the tutorial code. I wonder if the tf.scan version of a recurrent network is faster than its RNN implementation?
shape of ys_ is (?)
while shape of ys is (128, 20)
Am I missing something ?
thanks for this awesome implementation.
fyi, the input gate i = tf.sigmoid(tf.matmul(x,U[0]) + tf.matmul(st_1,W[0]))
typically uses tanh as the activation function (unlike other gates, which should use sigmoid).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.