Skip to content

Instantly share code, notes, and snippets.

View sleepsonthefloor's full-sized avatar

Anthony Young sleepsonthefloor

View GitHub Profile
# -*- coding: utf-8 -*-
"""Inception V3 model for Keras.
Note that the input image format for this model is different than for
the VGG16 and ResNet models (299x299 instead of 224x224),
and that the input preprocessing function is also different (same as Xception).
# Reference
- [Rethinking the Inception Architecture for Computer Vision](http://arxiv.org/abs/1512.00567)
@sleepsonthefloor
sleepsonthefloor / gist:2952b60e32540265cb0e81209d0bc1e8
Created September 5, 2018 17:28
Connect Four Positions that our best AlphaZero model + 10000 MCTS sims could not get right
For display purposes, 100% is rounded down to 99%
O's turn:
- - - - - - -
- - - - - - -
- - - - - - X
- - X O - - X
- - O X - - O
- X O X - - O
--------------------
@sleepsonthefloor
sleepsonthefloor / azfour_benchmark.py
Last active September 4, 2018 19:58
Benchmark Script for AZFour
import concurrent.futures
import numpy as np
from graphpipe import remote
import time
GP_SERVER = "http://127.0.0.1:9000"
WORKERS = 40
#!/usr/bin/env bash
# we will use the ``euca2ools`` cli tool that wraps the python boto
# library to test ec2 compatibility
echo "**************************************************"
echo "Begin DevStack Exercise: $0"
echo "**************************************************"
# This script exits on an error so that errors don't compound and you see
@sleepsonthefloor
sleepsonthefloor / gist:1822338
Created February 14, 2012 01:32
diablo.mysql.dump
-- MySQL dump 10.13 Distrib 5.1.58, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: keystone
-- ------------------------------------------------------
-- Server version 5.1.58-1ubuntu1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
-- MySQL dump 10.13 Distrib 5.1.54, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: keystone
-- ------------------------------------------------------
-- Server version 5.1.54-1ubuntu4
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
@sleepsonthefloor
sleepsonthefloor / gist:1820955
Created February 13, 2012 22:20
keystone migrate snippets
from sqlalchemy import create_engine
db = create_engine('mysql://root:secrete@192.168.2.10/keystone')
table_query = db.execute("show tables")
migration_data = {}
for table_name in table_query.fetchall():
table_name = table_name[0]
query = db.execute("describe %s" % table_name)
@sleepsonthefloor
sleepsonthefloor / xen_install_basics.sh
Created October 20, 2011 23:43
Install Basics for Xenserver Devstack
#!/bin/sh
set -o xtrace
# Install basics for vi and git
yum -y --enablerepo=base install gcc make vim-enhanced zlib-devel openssl-devel
# Simple but usable vimrc
cat > /root/.vimrc <<EOF
syntax on
se ts=4
# major version in package, like: nova-vncproxy_2011.1-dev-670_all
major_version: 2011.3-rcb
# ssh user
user: root
# use sudo for above user?
use_sudo: true
# base directory for package building
build_to: /srv/packages/build
# base directory for package serving
serve_to: /srv/packages/serve
--- a/django-openstack/django_openstack/auth/views.py
+++ b/django-openstack/django_openstack/auth/views.py
@@ -20,13 +20,14 @@ class Login(forms.SelfHandlingForm):
def handle(self, request, data):
try:
token = api.token_create(request,
- "",
+ data.get('tenant', ''),
data['username'],
data['password'])