Skip to content

Instantly share code, notes, and snippets.

View gazon1's full-sized avatar

Drobin Max gazon1

  • Moscow
View GitHub Profile
@ChillyBwoy
ChillyBwoy / main.js
Created September 4, 2011 22:17
JavaScript Date shift
var shiftDate = function(date, what, count) {
var proc1 = 'get' + what,
proc2 = 'set' + what;
var value = Date.prototype[proc1].call(date);
Date.prototype[proc2].call(date, value + count);
return date;
}
console.log(shiftDate(new Date, 'Date', -21));
@siemanko
siemanko / tf_lstm.py
Last active July 26, 2023 06:57
Simple implementation of LSTM in Tensorflow in 50 lines (+ 130 lines of data generation and comments)
"""Short and sweet LSTM implementation in Tensorflow.
Motivation:
When Tensorflow was released, adding RNNs was a bit of a hack - it required
building separate graphs for every number of timesteps and was a bit obscure
to use. Since then TF devs added things like `dynamic_rnn`, `scan` and `map_fn`.
Currently the APIs are decent, but all the tutorials that I am aware of are not
making the best use of the new APIs.
Advantages of this implementation: