Skip to content

Instantly share code, notes, and snippets.

View fedden's full-sized avatar
🤖
Training deep audio models

Leon Fedden fedden

🤖
Training deep audio models
View GitHub Profile
@fedden
fedden / CLA.md
Last active April 10, 2020 13:05
Individual Contributor License Agreement

Contributor License Agreement

The following terms are used throughout this agreement:

  • You - the person or legal entity including its affiliates asked to accept this agreement. An affiliate is any entity that controls or is controlled by the legal entity, or is under common control with it.
  • Project - is an umbrella term that refers to any and all open source projects owned by Leon Fedden related to machine learning and poker.
  • Contribution - any type of work that is submitted to a Project, including any modifications or additions to existing work.
  • Submitted - conveyed to a Project via a pull request, commit, issue, or any form of electronic, written, or verbal communication with Leon Fedden, contributors or maintainers.

1. Grant of Copyright License.

#
# Instructions:
#
# To install this script, run:
# wget <RAW_URL> -O - | bash
#
sudo apt-get update -y
sudo apt-get update -y
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.0.176-1_amd64.deb
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libcudnn7-dev_7.0.5.15-1+cuda9.0_amd64.deb
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libnccl2_2.1.4-1+cuda9.0_amd64.deb
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libnccl-dev_2.1.4-1+cuda9.0_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1604_9.0.176-1_amd64.deb
sudo dpkg -i libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb
sudo dpkg -i libcudnn7-dev_7.0.5.15-1+cuda9.0_amd64.deb
import dlib
from PIL import Image
from skimage import io
from skimage.transform import resize
def detect_faces(image):
"""Get face border positions for all the faces in the image.
Params:
# Create the model.
network = CharRNN(dataset.vocabulary_size,
dataset.sequence_length,
dropout_rate=0.5,
batch_size=512,
rnn_size=256,
amount_layers=3,
embedding_size=512,
learning_rate=0.001,
clip_norm=5.0)
class CharRNN():
def __init__(self,
vocabulary_size,
sequence_length,
dropout_rate=0.0,
batch_size=32,
rnn_size=128,
amount_layers=2,
embedding_size=32,
male_bios = ... # Downloaded bios as a list of strings.
# Create the dataset.
dataset = SequenceDataset(sequence_length=50)
# Create token sequences from the bios.
dataset.add_sequences_from_bios(male_bios)
class SequenceDataset():
def __init__(self, sequence_length):
"""Initialises the dataset class that contains the sequences that will be trained on.
Params:
sequence_length: int - the length of a sequence that will be fed to the RNN.
"""
self.sequence_length = sequence_length
@fedden
fedden / install.sh
Last active April 19, 2018 02:28
Home Automation Pi Install
#
# Instructions:
#
# To install this script, run:
# wget <RAW_URL> -O - | bash
#
# Update the OS and packages.
sudo apt-get update -y
sudo apt-get dist-upgrade -y
@fedden
fedden / facegan_cloud.sh
Last active April 14, 2018 03:35
facegan_cloud.sh
sudo apt-get update -y
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.0.176-1_amd64.deb
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libcudnn7-dev_7.0.5.15-1+cuda9.0_amd64.deb
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libnccl2_2.1.4-1+cuda9.0_amd64.deb
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libnccl-dev_2.1.4-1+cuda9.0_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1604_9.0.176-1_amd64.deb
sudo dpkg -i libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb
sudo dpkg -i libcudnn7-dev_7.0.5.15-1+cuda9.0_amd64.deb