Skip to content

Instantly share code, notes, and snippets.

!obj:pylearn2.train.Train {
dataset: &train !obj:pylearn2.datasets.mnist.MNIST {
which_set: 'train',
start: 0,
stop: 50000
},
model: !obj:galatea.adversarial.AdversaryPair {
generator: !obj:galatea.adversarial.Generator {
mlp: !obj:pylearn2.models.mlp.MLP {
layers: [
Traceback (most recent call last):
File "/u/ozairs/pylearn2/pylearn2/scripts/train.py", line 163, in <module>
train_obj = serial.load_train_file(args.config)
File "/u/ozairs/pylearn2/pylearn2/utils/serial.py", line 549, in load_train_file
return yaml_parse.load_path(config_file_path, environ=environ)
File "/u/ozairs/pylearn2/pylearn2/config/yaml_parse.py", line 102, in load_path
return load(content, environ=environ, **kwargs)
File "/u/ozairs/pylearn2/pylearn2/config/yaml_parse.py", line 64, in load
return instantiate_all(proxy_graph)
File "/u/ozairs/pylearn2/pylearn2/config/yaml_parse.py", line 156, in instantiate_all
import sys
import time
import numpy
import theano
import theano.tensor as T
from pylearn2.utils import serial
from pylearn2.config import yaml_parse
#include "llvm/Pass.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Instructions.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/User.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Support/raw_ostream.h"
import theano
import numpy
from theano import tensor as T
from PIL import Image
import os
import sys
import gzip
import cPickle
In [40]: A = randLILMatrix(10,10); A.set_type(FF(2))
In [45]: A
Out[45]:
⎡1 mod 2 0 mod 2 0 mod 2 0 mod 2 0 mod 2 1 mod 2 0 mod 2 1 mod 2 0 mod 2 1 mod 2⎤
⎢ ⎥
⎢0 mod 2 1 mod 2 1 mod 2 1 mod 2 0 mod 2 0 mod 2 1 mod 2 0 mod 2 1 mod 2 1 mod 2⎥
⎢ ⎥
⎢1 mod 2 0 mod 2 0 mod 2 0 mod 2 0 mod 2 1 mod 2 1 mod 2 1 mod 2 1 mod 2 0 mod 2⎥
⎢ ⎥
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Maintainer:
" Amir Salihefendic
" http://amix.dk - amix@amix.dk
"
" Version:
" 5.0 - 29/05/12 15:43:36
"
" Blog_post:
" http://amix.dk/blog/post/19691#The-ultimate-Vim-configuration-on-Github
@sherjilozair
sherjilozair / dqn.py
Created February 19, 2017 12:12
dqn impl in 150 lines
import random
import numpy as np
import gym
from scipy.misc import imresize
import tensorflow as tf
import tensorflow.contrib.slim as slim
class ReplayMemory:
def __init__(self, size=10**6, dims=(42, 42),
order=4, seqlen=1, mbsz=64):
sherjilozair-2:~ sherjil$ nimble install c2nim --verbose
Reading official package list
Downloading https://github.com/nim-lang/c2nim using git
Setting Nim stdlib prefix to
Setting Nim stdlib path to /Users/sherjil/.choosenim/toolchains/nim-#devel/lib
Warning: Package 'c2nim' has an incorrect structure. The top level of the package source directory should contain at most one module, named 'c2nim.nim', but a file named 'rules.nim' was found. This will be an error in the future.
Hint: If this is the primary source file in the package, rename it to 'c2nim.nim'. If it's a source file required by the main module, or if it is one of several modules exposed by 'c2nim', then move it into a 'c2nimpkg/' subdirectory. If it's a test file or otherwise not required to build the the package 'c2nim.nim', prevent its installation by adding `skipFiles = @["rules.nim"]` to the .nimble file. See https://github.com/nim-lang/nimble#libraries for more info.
Setting Nim stdlib prefix to
Setting Nim stdli
@sherjilozair
sherjilozair / specnorm.py
Last active May 3, 2018 03:08
Spectral Normalization
import tensorflow as tf
import numpy as np
class SpecNorm(object):
def build(self, input_shape):
self.indim = input_shape[-1] * np.array(self.kernel_size).prod()
self.outdim = self.filters
self.u = self.add_variable(name='u', shape=(1, self.indim), trainable=False)
self.v = self.add_variable(name='v', shape=(self.outdim, 1), trainable=False)
super().build(input_shape)