View reduce_lr_keras_issue.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''Trains a simple convnet on the MNIST dataset. | |
Gets to 99.25% test accuracy after 12 epochs | |
(there is still a lot of margin for parameter tuning). | |
16 seconds per epoch on a GRID K520 GPU. | |
''' | |
from __future__ import print_function | |
import numpy as np | |
np.random.seed(1337) # for reproducibility |
View vis_rekognition_gfs_overlapping_indices.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collections | |
import json | |
def duplicates(): | |
# | |
# organize raw Rekognition `boto3.client('rekognition').get_face_search()` response for debugging this issue | |
# | |
with open('duplicated_index_bug.json', 'r') as f: # https://s3.us-east-2.amazonaws.com/brayniac-waya-ai/duplicated_index_bug.json |
View rekognition_video_face_search_uncertainty.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collections | |
def sort_raw_rekognition_results(results): | |
indices = collections.defaultdict(list) # unique people detected in video to a `list` of their `PersonMatch` objects | |
timestamps = collections.defaultdict(list) # `lists` maintain order so we can keep track of people and their indices | |
timestamps_indices = collections.defaultdict(list) | |
for p in self.results['Persons']: |
View uport.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://unpkg.com/uport-connect/dist/uport-connect.min.js"></script> | |
<script src="https://unpkg.com/axios/dist/axios.min.js"></script> | |
<script type="text/javascript"> | |
function uport() { | |
try { | |
const u = new window.uportconnect.Connect('blockimmo', { | |
clientId: '2ohEPzgzsh7gm68BUcHQMkfaQs8BA4ysatY', | |
network: 'rinkeby', |
View main.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io | |
import boto3 | |
import PIL.Image | |
import torch | |
from torch.utils import model_zoo | |
import torchvision | |
s3_client = boto3.client('s3') |
View dynamic_ec2.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ec2_client = boto3.client('ec2') | |
user_data = """#!/bin/bash | |
sudo apt-get update | |
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" | |
sudo python3 get-pip.py | |
sudo pip3 install boto3 | |
sudo apt-get install -y libgtk2.0-dev | |
sudo pip3 install opencv-python | |
echo "{}" >> {} |
View ResNeXt_gan.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from keras import layers | |
from keras import models | |
import tensorflow as tf | |
# | |
# generator input params | |
# | |
rand_dim = (1, 1, 2048) # dimension of the generator's input tensor (gaussian noise) |
View pytorch-lambda-deploy.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# written for Amazon Linux AMI | |
# creates an AWS Lambda deployment package for pytorch deep learning models (Python 3.6.1) | |
# assumes lambda function defined in ~/main.py | |
# deployment package created at ~/waya-ai-lambda.zip | |
# | |
# | |
# install python 3.6.1 | |
# |
View improved_wGAN_loss.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
wGAN implemented on top of tensorflow as described in: [Wasserstein GAN](https://arxiv.org/pdf/1701.07875.pdf) | |
with improvements as described in: [Improved Training of Wasserstein GANs](https://arxiv.org/pdf/1704.00028.pdf). | |
""" | |
import tensorflow as tf | |
# |
View install-tesla-driver-ubuntu.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://www.nvidia.com/download/driverResults.aspx/117079/en-us | |
wget http://us.download.nvidia.com/tesla/375.51/nvidia-driver-local-repo-ubuntu1604_375.51-1_amd64.deb | |
sudo dpkg -i nvidia-driver-local-repo-ubuntu1604_375.51-1_amd64.deb | |
sudo apt-get update | |
sudo apt-get -y install cuda-drivers | |
echo "Reboot required." |
OlderNewer