Skip to content

Instantly share code, notes, and snippets.

@dpino
dpino / ns-inet.sh
Last active April 19, 2024 18:12
Setup a network namespace with Internet access
#!/usr/bin/env bash
# set -x
if [[ $EUID -ne 0 ]]; then
echo "You must be root to run this script"
exit 1
fi
# Returns all available interfaces, except "lo" and "veth*".
@sehugg
sehugg / nietz_stateful.py
Last active October 16, 2017 19:45
Stateful LSTM text generation with Keras 1.0
#!/usr/bin/env python
from __future__ import print_function
from keras.models import Sequential
from keras.layers import TimeDistributed
from keras.layers.core import Dense, Activation, Dropout, RepeatVector, TimeDistributedDense
from keras.layers.recurrent import LSTM
from keras.utils.data_utils import get_file
import numpy as np
import random,string
import sys
@nicksam112
nicksam112 / keras_es.py
Last active November 28, 2020 16:02
Evolution Strategies with Keras
#Evolution Strategies with Keras
#Based off of: https://blog.openai.com/evolution-strategies/
#Implementation by: Nicholas Samoray
#README
#Meant to be run on a single machine
#APPLY_BIAS is currently not working, keep to False
#Solves Cartpole as-is in about 50 episodes
#Solves BipedalWalker-v2 in about 1000
@mtesseracted
mtesseracted / numpyrotate.py
Last active March 10, 2019 12:40
NumPy logo in rotating voxels
'''
matplotlib must be developer release for voxel support
install instructions:
https://matplotlib.org/devdocs/users/installing.html
'''
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.animation as manimation