Skip to content

Instantly share code, notes, and snippets.

View RicherMans's full-sized avatar

Heinrich Dinkel RicherMans

View GitHub Profile
import numpy as np
import pandas as pd
import torch.nn.functional as F
import torch
import torch.nn as nn
import torchnet as tnt
import librosa
from tqdm import tqdm
import os
import argparse
@RicherMans
RicherMans / assignment3.py
Created January 8, 2018 12:18
Assignment3 in dsp coursera course. Efficient matrix implementation
import numpy as np
def subband_filtering(x, h):
""" ASSIGNMENT 3
Write a routine to implement the efficient version of the subband filter
as specified by the MP3 standard
Arguments:
x: a new 512-point data buffer, in time-reversed order [x[n],x[n-1],...,x[n-511]].
[ 16229.573] (--) Log file renamed from "/home/richman/.local/share/xorg/Xorg.pid-17257.log" to "/home/richman/.local/share/xorg/Xorg.0.log"
[ 16229.574]
X.Org X Server 1.19.6
Release Date: 2017-12-20
[ 16229.574] X Protocol Version 11, Revision 0
[ 16229.574] Build Operating System: Linux 4.9.71-1-lts x86_64
[ 16229.574] Current Operating System: Linux lazor 4.15.0-1-MANJARO #1 SMP PREEMPT Sun Dec 24 07:39:02 UTC 2017 x86_64
[ 16229.574] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.15-x86_64 root=UUID=73baad87-869c-45f3-8696-ce5c40ae70e6 rw resume=UUID=6a184fd2-3308-4130-b65c-72b4e3272f8a
[ 16229.574] Build Date: 25 December 2017 02:02:38PM
[ 16229.574]
@RicherMans
RicherMans / assignment2.py
Created December 28, 2017 07:15
Assignment2 DSP
from scipy import signal
import numpy as np
def pitohz(x):
return x/(np.pi*2)
def prototype_filter():
""" ASSIGNMENT 2
@RicherMans
RicherMans / train.py
Last active October 17, 2017 13:12
DNN implementation for Homework Classification
# -*- coding: utf-8 -*-
# @Author: richman
# @Date: 2017-10-17 19:04:18
# @Last Modified by: richman
# @Last Modified time: 2017-10-17 21:12:09
import torch
from torchnet.engine import Engine
import torchnet as tnt
import numpy as np
@RicherMans
RicherMans / config
Last active October 20, 2017 02:07
i3 config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@RicherMans
RicherMans / bashargs.sublime-snippet
Created May 23, 2017 08:07
bashargs.sublime-snippet
<snippet>
<content><![CDATA[
# Arguments: ${1:arg}
function usage {
echo "Error, please use the following parameters:" # unknown option
echo "./$TM_FILENAME ${1/(\A\s*,\s*\Z)|,?\s*([A-Za-z_][a-zA-Z0-9_]*)\s*(=[^,]*)?(,\s*|$)/(?2:-$2 /g} ..."
exit
}
[[ \$# -lt $2 ]] && usage
@RicherMans
RicherMans / 10-monitor.conf
Created March 3, 2017 04:06
Xrandr Config for dual monitor on XFCE
Section "Monitor"
Identifier "eDP1"
Option "Primary" "true"
EndSection
Section "Monitor"
Identifier "DP1"
Option "LeftOf" "eDP1"
EndSection
@RicherMans
RicherMans / argparse.sublime-snipplet
Created February 16, 2017 03:33
Argparse sipplet sublime
<snippet>
<content><![CDATA[
import argparse
parser = argparse.ArgumentParser()
""" Arguments: ${1:arg} """
${1/(\A\s*,\s*\Z)|,?\s*([A-Za-z_][a-zA-Z0-9_]*)\s*(=[^,]*)?(,\s*|$)/(?2:parser.add_argument\('$2'\)\n)/g}
args = parser.parse_args()
]]></content>
@RicherMans
RicherMans / Audiodataload.lua
Created October 24, 2016 14:10
torch example of using audiodataload
require 'torch'
require 'optim'
require 'nn'
require 'audio'
require 'xlua'
local adl = require 'audiodataload'
-- Parsing of the commandline arguments
function cmdlineargs(arg)
local cmd = torch.CmdLine()