Skip to content

Instantly share code, notes, and snippets.

View philipperemy's full-sized avatar
🇨🇵
Solving AI together.

Philippe Rémy philipperemy

🇨🇵
Solving AI together.
View GitHub Profile
from __future__ import print_function
import numpy as np
from keras.callbacks import Callback
from keras.layers import Dense
from keras.layers import LSTM
from keras.models import Sequential
from numpy.random import choice
from utils import prepare_sequences
from __future__ import print_function
import os
import numpy as np
from keras.layers import RepeatVector
from keras.layers.core import Dropout
from keras.layers.recurrent import LSTM
from keras.models import Sequential
from keras.models import load_model
from __future__ import print_function
import os
import numpy as np
from keras.layers import RepeatVector
from keras.layers.core import Dropout
from keras.layers.recurrent import LSTM
from keras.models import Sequential
from keras.models import load_model
@philipperemy
philipperemy / lstm-keras-stateful-variable-length.py
Created January 16, 2017 01:47
LSTM Keras Stateful for variable length inputs
from __future__ import print_function
import numpy as np
from keras.layers import Dense
from keras.layers import LSTM
from keras.models import Sequential
from numpy.random import choice
USE_SEQUENCES = False
USE_STATELESS_MODEL = False
@philipperemy
philipperemy / pickle_view.py
Created March 14, 2017 05:52
Pickle viewer in command line! Put it here /usr/bin/pickle_view.py
#!/usr/bin/env python
import pickle
import sys
if __name__ == '__main__':
argv = sys.argv
if len(argv) <= 1:
print 'Specify pickle file as parameter.'
@philipperemy
philipperemy / keras_var_length.py
Created March 15, 2017 01:16
Keras variable length LSTM
from __future__ import print_function
import numpy as np
from keras.layers import Dense
from keras.layers import LSTM
from keras.models import Sequential
from numpy.random import choice
USE_SEQUENCES = False
USE_STATELESS_MODEL = False
var https = require('https'),
user = process.argv[2],
opts = parseOpts(process.argv.slice(3))
request('/users/' + user, function (res) {
if (!res.public_repos) {
console.log(res.message)
return
}
var pages = Math.ceil(res.public_repos / 100),
@philipperemy
philipperemy / install.sh
Created December 23, 2017 08:15
Install Neural Style Transfer
# Ubuntu:14.04 - 64 bits
# MINIMUM IS 8GB OF RAM.
curl -sk https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash
git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; ./install.sh
. ~/.bashrc # or: . ~/.zshrc
luarocks install nn
luarocks install nngraph
#!/usr/bin/env python
"""
Produces load on all available CPU cores
"""
from multiprocessing import Pool
from multiprocessing import cpu_count
def f(x):
while True:
@philipperemy
philipperemy / extract.sh
Last active June 22, 2018 02:37
Mac OS - extract handshakes from CAP files of airport command
# On Mac OSX
# Will run AIRODUMP scan of all BSSIDs
# sudo airport -s
# Will run AIRODUMP sniff on channel 11
# sudo airport en0 sniff 11
# Atm, I can't find how to sniff on all channels at the same time.
if [ $# -eq 0 ]