Skip to content

Instantly share code, notes, and snippets.

@ilkerkesen
ilkerkesen / .gitignore_global
Created January 18, 2015 00:18
Global .gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.pyc
a.out
@ilkerkesen
ilkerkesen / train.jl
Created July 12, 2016 12:06
MLP - MNIST
using MNIST
sigmoid(z) = 1 ./ (1 + exp(-z))
# load MNIST data
println("Loading MNIST dataset...")
X_train, y_train = traindata()
X_test, y_test = testdata()
y_train, y_test = y_train', y_test'
# mean normalization
@ilkerkesen
ilkerkesen / mnist1d.py
Last active September 27, 2016 17:24
Caffe 1-dimension input with LMDB
import os
import gzip
import numpy as np
import lmdb
import caffe
import six.moves.cPickle as pickle
def load_data(dataset):
data_dir, data_file = os.path.split(dataset)
@ilkerkesen
ilkerkesen / caffe.log
Last active October 4, 2016 19:21
Caffe Inconsistent Loss
$ sh leakage.sh
WARNING: Logging before InitGoogleLogging() is written to STDERR
I1004 19:15:11.682617 8069 net.cpp:58] Initializing net from parameters:
name: "Housing"
state {
phase: TRAIN
level: 0
}
layer {
type: "MemoryData"
@ilkerkesen
ilkerkesen / error.log
Created April 6, 2017 08:45
Knet Issue #108
julia> using Knet
INFO: Knet using GPU 0
julia> a = randn(10, 20); k = KnetArray(a);
julia> k.^2
10×20 Knet.KnetArray{Float64,2}:
NaN 3.71246 0.317756 NaN NaN NaN … NaN 0.854236 2.45753 3.18989 NaN
NaN 2.89357 0.410529 0.341318 8.44459 0.390959 0.123474 NaN 0.25356 NaN NaN
0.878611 0.0585478 NaN 0.758786 0.600756 NaN NaN NaN 0.44549 NaN 0.289267
@ilkerkesen
ilkerkesen / reduction-timing1.log
Last active April 6, 2017 19:40
Knet Reduction Timings
6-element Array{Tuple{Int64,Int64},1}:
(100,100)
(500,500)
(100,1000)
(1000,100)
(100,60000)
(60000,100)
julia> a = randn(Float32, ds[1]...);
@ilkerkesen
ilkerkesen / errortrace.txt
Created December 2, 2017 14:23
cuarrays - indexing
julia> include("indexing.jl")
summary(a) = "4×4×4 Array{Float64,3}"
summary(a[:, 2, 2]) = "4-element Array{Float64,1}"
summary(a[:, [2, 4], 2]) = "4×2 Array{Float64,2}"
summary(a[:, [2, 4], [1, 3]]) = "4×2×2 Array{Float64,3}"
summary(a[:, [2, 4], :]) = "4×2×4 Array{Float64,3}"
summary(a[:, 2:4, :]) = "4×3×4 Array{Float64,3}"
summary(a[:, 1:2:4, :]) = "4×2×4 Array{Float64,3}"
summary(a) = "4×4×4 CuArray{Float64,3}"
summary(a[:, 2, 2]) = "4-element CuArray{Float64,1}"
@ilkerkesen
ilkerkesen / rnnlm-timing.txt
Created December 3, 2017 18:33
RNNLM Profiling
─────────────────────────────────────────────────────────────────────────────────────
Time Allocations
────────────────────── ───────────────────────
Tot / % measured: 207s / 26.0% 99.3MiB / 55.3%
Section ncalls time %tot avg alloc %tot avg
─────────────────────────────────────────────────────────────────────────────────────
back1.Knet.logp 1.00k 10.2s 19.0% 10.2ms 2.94MiB 5.36% 3.01KiB
forw.* 1.00k 10.1s 18.8% 10.1ms 2.77MiB 5.06% 2.84KiB
back2.AutoGrad.broadcast#+ 1.00k 6.05s 11.3% 6.05ms 652KiB 1.16% -
julia> using Knet
ERROR: InitError: cudart.cudaRuntimeGetVersion error 38
Stacktrace:
[1] gpu(::Bool) at /KUFS/scratch/ikesen16/.julia/newnode/v0.6/Knet/src/gpu.jl:13
[2] __init__() at /KUFS/scratch/ikesen16/.julia/newnode/v0.6/Knet/src/Knet.jl:59
[3] _include_from_serialized(::String) at ./loading.jl:157
[4] _require_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at ./loading.jl:200
[5] _require_search_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at ./loading.jl:236
[6] _require(::Symbol) at ./loading.jl:434
[7] require(::Symbol) at ./loading.jl:398
@ilkerkesen
ilkerkesen / .bash_profile
Last active February 4, 2018 12:19
COMP 541 - KUACC Configuration
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
export TERM=xterm
export SCRATCH=/scratch/users/$USER
export JULIA_PKGDIR=$SCRATCH/.julia
# modules