Skip to content

Instantly share code, notes, and snippets.

Youssef Kashef kashefy

  • Berlin, Germany
View GitHub Profile
@kashefy
kashefy / conv2d.py
Created Jan 13, 2016
2d convolution using numpy
View conv2d.py
'''
Created on Jul 13, 2015
@author: kashefy
'''
import numpy as np
from scipy import signal
if __name__ == '__main__':
View neuron76-py3
sudo apt-get install gnome-devel
sudo apt-get install python3-dev
sudo apt-get install libcr-dev mpich mpich-doc
sudo apt-get install libncursesw5-dev ncurses-base ncurses-bin ncurses-term
sudo apt-get install gnome-devel python3-dev libcr-dev mpich mpich-doc libncursesw5-dev ncurses-base ncurses-bin ncurses-term
export PYTHON3PATH=`which python3`
export HOME_DIR=`pwd`
View gist:ea1cc7b95ac86ac5c67a6248c66cbc58
sudo apt-get install gnome-devel
sudo apt-get install python3-dev
sudo apt-get install libcr-dev mpich mpich-doc
sudo apt-get install libncursesw5-dev ncurses-base ncurses-bin ncurses-term
sudo apt-get install gnome-devel python3-dev libcr-dev mpich mpich-doc libncursesw5-dev ncurses-base ncurses-bin ncurses-term
export PYTHON3PATH=`which python3`
export HOME_DIR=`pwd`
View install_caffe_deps.sh
# Installing Caffe dependencies without sudo privileges:
# The prefix serves as the installation directory for caffe dependencies
# that are not already installed on the system
#
# Set "inputs" according to host machine
export PREFIX_HOST=/mnt/scratch/$USER/caffe_deps
export PREFIX_CUDNN=$PREFIX_HOST/../build/cudnn-7.5
View parse_tf_events_file.py
import tensorflow as tf
# adapted from https://stackoverflow.com/a/40029298/2466336
if __name__ == '__main__':
path_to_events_file = '/home/kashefy/models/ae/log_simple_stats/2017-07-18_12-22-45/events.out.tfevents.1500373527.hobbes'
tag = 'mlp_layer-1/loss_classification_1'
# with open(fpath, "r") as f:
#
#
@kashefy
kashefy / tf_restore.py
Created Sep 7, 2017
Try out saving and restoring Tensorflow variables defined using tf.get_variable
View tf_restore.py
'''
Created on Aug 18, 2017
@author: kashefy
'''
import os
import shutil
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import numpy as np
@kashefy
kashefy / find_circV
Created Jan 6, 2017
grep -nHIrF --include=*.m -- circV
View find_circV
./auditory-front-end/src/Processors/pitchProc.m:236: pObj.maxConfBuf = circVBuf(bufferDurSec*pObj.FsHzIn,1);
./auditory-front-end/src/Processors/pitchProc.m:237: pObj.maxConf = circVBufArrayInterface(pObj.maxConfBuf);
./auditory-front-end/src/Signals/circVBuf.m:1:classdef circVBuf < handle
./auditory-front-end/src/Signals/circVBuf.m:2: %circVBuf class defines a circular double buffered vector buffer
./auditory-front-end/src/Signals/circVBuf.m:51: % example 1 - loop over new vectors of a circVBuf (slow because of copy):
./auditory-front-end/src/Signals/circVBuf.m:52: % for ix=circVBufObj.VBuf.new:circVBuf.VBuf.lst
./auditory-front-end/src/Signals/circVBuf.m:53: % vec(:) = circVBuf.VBuf.raw(:,bId);
./auditory-front-end/src/Signals/circVBuf.m:57: % new = circVBuf.VBuf.new;
./auditory-front-end/src/Signals/circVBuf.m:58: % lst = circVBuf.VBuf.lst;
./auditory-front-end/src/Signals/circVBuf.m:59: % mean = mean(circVBuf.VBuf.raw(3:7,new:lst));
@kashefy
kashefy / moving_avg.py
Last active Jul 29, 2016
Moving average for a time series
View moving_avg.py
import numpy as np
def moving_avg(x, window_size):
window = np.ones(int(window_size)) / float(window_size)
return np.convolve(x, window, 'valid')
@kashefy
kashefy / lower_samplerate_cmds.py
Last active May 26, 2016
downsample sound files using ffmpeg
View lower_samplerate_cmds.py
def is_wav(p):
return os.path.splitext(p)[-1] == '.wav'
def lower_samplerate_cmds(dir_src, samplerate, dir_dst, fpath_exec_script):
paths = fs.gen_paths(dir_src, is_wav)
commands = []
for fpath in paths:
path_dst = os.path.join(dir_dst, os.path.basename(fpath))
@kashefy
kashefy / 59_labels.txt
Last active Feb 20, 2016
The 59 labels subset for PASCAL Context dataset. Originally from here: http://www.cs.stanford.edu/~roozbeh/pascal-context/59_labels.txt
View 59_labels.txt
1: aeroplane
2: bicycle
3: bird
4: boat
5: bottle
6: bus
7: car
8: cat
9: chair
10: cow
You can’t perform that action at this time.