This file contains hidden or 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
''' | |
Created on Jun 16, 2015 | |
@author: kashefy | |
''' | |
import argparse | |
import os | |
def list_paths(root_path): |
This file contains hidden or 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
2008_000002 | |
2008_000003 | |
2008_000007 | |
2008_000009 | |
2008_000016 | |
2008_000021 | |
2008_000026 | |
2008_000027 | |
2008_000032 | |
2008_000034 |
This file contains hidden or 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 os | |
def gen_paths(dir_src, func_filter=None): | |
if func_filter is None: | |
def func_filter(fileName): | |
return True | |
dst = [] | |
This file contains hidden or 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
# 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 |
This file contains hidden or 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
''' | |
Created on Jul 13, 2015 | |
@author: kashefy | |
''' | |
import numpy as np | |
from scipy import signal | |
if __name__ == '__main__': | |
This file contains hidden or 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 <typename Dtype> | |
void printMat(const Dtype* data, int rows, int cols) { | |
int j = 0; | |
std::cout<<"np.array(["; | |
for (int r=0; r<rows; r++) { | |
std::cout<<"["; | |
for (int c=0; c<cols; c++) { | |
std::cout<<data[j++]; | |
if (c<cols-1) std::cout<<","; | |
} |
This file contains hidden or 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
name: "MNISTAutoencoderTiedWeights" | |
layer { | |
name: "mnist" | |
type: "Data" | |
top: "data" | |
top: "label" | |
include { | |
phase: TRAIN | |
} | |
transform_param { |
This file contains hidden or 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
1: aeroplane | |
2: bicycle | |
3: bird | |
4: boat | |
5: bottle | |
6: bus | |
7: car | |
8: cat | |
9: chair | |
10: cow |
This file contains hidden or 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
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)) |
This file contains hidden or 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 numpy as np | |
def moving_avg(x, window_size): | |
window = np.ones(int(window_size)) / float(window_size) | |
return np.convolve(x, window, 'valid') |
OlderNewer