Skip to content

Instantly share code, notes, and snippets.

View cancan101's full-sized avatar

Alex Rothberg cancan101

View GitHub Profile
import os
os.environ['THEANO_FLAGS']="optimizer_including=conv_fft_valid:conv_fft_full"
from pylearn2.config import yaml_parse
from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix
import numpy as np
train_str = """!obj:pylearn2.train.Train {
dataset: &train !import '__main__ .train_set',
import os
os.environ['PYLEARN2_DATA_PATH'] = '/home/ubuntu/data'
import numpy as np
import cv2
from pylearn2.config import yaml_parse
from pylearn2.datasets.mnist import MNIST
from pylearn2.datasets import preprocessing
@cancan101
cancan101 / Statsmodels Formula.ipynb
Created December 20, 2014 23:51
Statsmodels Formula
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
diff --git a/nolearn/lasagne.py b/nolearn/lasagne.py
index 5c2c64c..86f2e7a 100644
--- a/nolearn/lasagne.py
+++ b/nolearn/lasagne.py
@@ -22,7 +22,21 @@ from theano import tensor as T
class _list(list):
- pass
+ def set_params(self, **params):
@cancan101
cancan101 / travis.yml
Created March 24, 2015 05:52
travis yaml
sudo: true
language: python
cache:
directories:
- $HOME/.cache/pip
python:
- '2.7'
env:
- SERVICE=s1
- SERVICE=s2
import sqlite3
import threading
db = sqlite3.connect(":memory:", check_same_thread=False)
CREATE_NON_LINKED_TABLE = 'CREATE TABLE IF NOT EXISTS %s (id INTEGER PRIMARY KEY AUTOINCREMENT, original, cleaned, UNIQUE(original))'
CREATE_LINKED_TABLE = 'CREATE TABLE IF NOT EXISTS %s (id INTEGER PRIMARY KEY AUTOINCREMENT, original, cleaned, study INTEGER, UNIQUE(original, study), FOREIGN KEY(study) REFERENCES studyinstanceuid(id))'
db.isolation_level = None
db.execute(CREATE_NON_LINKED_TABLE % 'studyinstanceuid')
db.execute(CREATE_LINKED_TABLE % 'patientsname')
@cancan101
cancan101 / $ref-issue.json
Created May 11, 2015 04:16
Issue with $ref in Swagger 1.2
{
"swaggerVersion": "1.2",
"apis": [
{
"operations": [
{
"parameters": [
{
{
"swaggerVersion": "1.2",
"apis": [
{
"operations": [
{
"parameters": [
{
#!/bin/sh
"exec" "python" "-u" "--" "$0" "$@"
import os
import sys
import time
class ForceIOStream:
@cancan101
cancan101 / install-tensorflow.sh
Created February 3, 2016 20:05 — forked from erikbern/install-tensorflow.sh
Installing TensorFlow on EC2
# Note – this is not a bash script (some of the steps require reboot)
# I named it .sh just so Github does correct syntax highlighting.
#
# This is also available as an AMI in us-east-1 (virginia): ami-cf5028a5
#
# The CUDA part is mostly based on this excellent blog post:
# http://tleyden.github.io/blog/2014/10/25/cuda-6-dot-5-on-aws-gpu-instance-running-ubuntu-14-dot-04/
# Install various packages
sudo apt-get update