Skip to content

Instantly share code, notes, and snippets.

View FragLegs's full-sized avatar

Shayne Miel (he/him) FragLegs

  • Duo Security
  • Durham, NC
View GitHub Profile
@FragLegs
FragLegs / DB scripts.md
Created January 17, 2020 21:38
DB scripts

TOTAL DISK SIZE

WITH sizes AS (SELECT nspname || '.' || relname AS "relation",
    pg_total_relation_size(C.oid) AS "total_size"
  FROM pg_class C
  LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
  WHERE nspname NOT IN ('pg_catalog', 'information_schema')
    AND C.relkind <> 'i'
    AND nspname !~ '^pg_toast'
) SELECT pg_size_pretty(SUM(total_size)) FROM sizes;
@FragLegs
FragLegs / attention_lstm.py
Created April 28, 2017 03:03 — forked from mbollmann/attention_lstm.py
My attempt at creating an LSTM with attention in Keras
class AttentionLSTM(LSTM):
"""LSTM with attention mechanism
This is an LSTM incorporating an attention mechanism into its hidden states.
Currently, the context vector calculated from the attended vector is fed
into the model's internal states, closely following the model by Xu et al.
(2016, Sec. 3.1.2), using a soft attention model following
Bahdanau et al. (2014).
The layer expects two inputs instead of the usual one:
@FragLegs
FragLegs / run.sh
Last active December 19, 2016 03:07
Description for how to obtain Atari Skiing results
# start a new virtualenv
git clone git@github.com:FragLegs/learning2ski.git .
pip install -r requirements.txt
python eval.py -e 150 --monitor --seed 42 l2s
# If you leave off the --monitor flag, the results are a little better