Skip to content

Instantly share code, notes, and snippets.

View gazon1's full-sized avatar

Drobin Max gazon1

  • Moscow
View GitHub Profile
@gazon1
gazon1 / _.py
Created June 22, 2020 04:13
Как сервисы наподобие youtube завладевавают вниманием?
# Как сервисы наподобие youtube завладевавают вниманием?
# Пусть вероятность отвлечься на один фактор = 10%, тогда, если факторов уже 10 (их
# расположение не имеет значения - то есть можно их менять местами), то:
def C(n, k):
if 0 <= k <= n:
nn = 1
kk = 1
for t in range(1, min(k, n - k) + 1):
@gazon1
gazon1 / sh
Created July 27, 2019 07:07
aliases for ml enginier
#!/Bin/bash
# https://unix.stackexchange.com/questions/423401/show-error-message-if-bash-script-terminates-due-to-set-e
set -e
err_report() {
echo "Error on line $1"
}
@gazon1
gazon1 / sh
Created July 27, 2019 06:50
bash script: wget site with relative path
#!/bin/bash
# credit for catching error:
# https://unix.stackexchange.com/questions/423401/show-error-message-if-bash-script-terminates-due-to-set-e
set -e
err_report() {
echo "Error on line $1"
}
@gazon1
gazon1 / tf_lstm.py
Created March 11, 2018 07:52 — forked from siemanko/tf_lstm.py
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: