Skip to content

Instantly share code, notes, and snippets.

View iamaaditya's full-sized avatar
💭
Better Approximations

aaditya prakash iamaaditya

💭
Better Approximations
View GitHub Profile
import numpy as np
from keras.layers import Dropout
from keras import applications
from keras.layers import Dense, GlobalAveragePooling2D, merge, Input
from keras.models import Model
max_words = 10000
epochs = 50
batch_size = 32
@iamaaditya
iamaaditya / xla-test.py
Created January 29, 2017 16:34 — forked from yaroslavvb/xla-test.py
Simple XLA benchmark
# XLA compilation controlled by "compile_ops" option
# compile_ops=False: 4.39 sec
# compile_ops=True: 0.90 sec
import os
os.environ['CUDA_VISIBLE_DEVICES']=''
import tensorflow as tf
@iamaaditya
iamaaditya / ops.py
Created August 30, 2016 03:04 — forked from raingo/ops.py
multi dimensional softmax with tensorflow
import tensorflow as tf
"""
Multi dimensional softmax,
refer to https://github.com/tensorflow/tensorflow/issues/210
compute softmax along the dimension of target
the native softmax only supports batch_size x dimension
"""
def softmax(target, axis, name=None):
" cVim configuration -- Aaditya Prakash
" gist id -- ed0f4da609dde6b71b43
" Settings
"set noautofocus
set cncpcompletion
set smoothscroll
set nohud
# from: http://www.4dsolutions.net/cgi-bin/py2html.cgi?script=/ocn/python/primes.py
"""
primes.py -- Oregon Curriculum Network (OCN)
Feb 1, 2001 changed global var primes to _primes, added relative primes test
Dec 17, 2000 appended probable prime generating methods, plus invmod
Dec 16, 2000 revised to use pow(), removed methods not in text, added sieve()
Dec 12, 2000 small improvements to erastosthenes()
Dec 10, 2000 added Euler test
Oct 3, 2000 modified fermat test
import ossaudiodev as oss
from numpy import fft
import math
import pygame
import pygame.surfarray as surfarray
d = oss.open('rw')
d.setfmt(oss.AFMT_U16_LE)
d.channels(1)