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
[global] | |
floatX = float32 | |
device = gpu | |
config.openmp = True | |
OMP_NUM_THREADS=8 | |
config.dnn.conv.algo_fwd='winograd' | |
config.dnn.conv.algo_bwd_data='winograd' | |
config.gcc.cxxflags="-march=native" | |
[lib] |
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
# | |
# /etc/makepkg.conf | |
# | |
######################################################################### | |
# SOURCE ACQUISITION | |
######################################################################### | |
# | |
#-- The download utilities that makepkg should use to acquire sources | |
# Format: 'protocol::agent' |
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
# yaourtrc - Configuration for yaourt | |
# | |
# See yaourtrc(5) for more information | |
# | |
# | |
# General | |
#AUTOSAVEBACKUPFILE=0 | |
DEVEL=1 | |
DEVELSRCDIR="/pkg/devel" |
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
# ~/.R/Makevars | |
PKG_LIBS = -fopenmp -lgomp | |
PKG_CFLAGS=-O3 -pipe -fstack-protector-strong -fopenmp -march=native | |
#-- Compiler and Linker Flags | |
# -march (or -mcpu) builds exclusively for an architecture | |
# -mtune optimizes for an architecture, but builds for whole processor family | |
CPPFLAGS=-D_FORTIFY_SOURCE=2 | |
CFLAGS=-O3 -pipe -fstack-protector-strong -fopenmp -march=native | |
CXXFLAGS=-O3 -pipe -fstack-protector-strong -fopenmp -march=native |
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 options | |
import future | |
import sequtils | |
# Unfolding the Nim Magic | |
## Bug https://github.com/nim-lang/Nim/issues/5647 open. | |
## unfold proper type signature should have Option[(T, U)] instead of Option[(T, T)] | |
# proc unfoldr*[T, U](f: U -> Option[(T, U)], x:U): seq[T] {. inline .}= |
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
template scanr[T](s: seq[T], operation: untyped): untyped = | |
## Template to scan a sequence from right to left, returning the accumulation and intermediate values. | |
## This is a foldr with intermediate steps returned | |
## @[2, 2, 3, 5].scanr(a + b) = @[48, 24, 12, 4] | |
let len = s.len | |
assert len > 0, "Can't scan empty sequences" | |
var result = newSeq[T](len) |
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
# Deleted pointer arithmetic routines | |
# Original data structure with pointer: | |
type Tensor*[B: static[Backend]; T] = object | |
# Size of the datastructure is 32 bytes - perfect ! | |
dimensions: seq[int] | |
strides: seq[int] | |
offset: ptr T | |
data: seq[T] # Perf note: seq are always deep copied on assignement. |
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 gzip | |
import json | |
import requests | |
try: | |
from cStringIO import StringIO | |
except: | |
from StringIO import StringIO | |
# Let's fetch the Common Crawl FAQ using the CC index | |
resp = requests.get('http://index.commoncrawl.org/CC-MAIN-2015-27-index?url=http%3A%2F%2Fcommoncrawl.org%2Ffaqs%2F&output=json') |
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
type | |
Context*[T] = ref object | |
nodes: seq[T] | |
Variable*[T; C: static[Context[T]]] = object | |
tape: Context[T] | |
index: int | |
value: T | |
proc newContext*[T]: Context[T] {.noSideEffect.} = |