Skip to content

Instantly share code, notes, and snippets.

View abinashpanda's full-sized avatar
🏠
Working from home

Abinash Panda abinashpanda

🏠
Working from home
  • Bangalore, India
View GitHub Profile
@abinashpanda
abinashpanda / simple_filter.py
Created September 19, 2013 20:44
Simple Filter Design for Noise Removal
#!/usr/bin/env python
import scipy.fftpack as fftpack
import scipy.io.wavfile as wav
import numpy as np
import matplotlib.pylab as plt
# Reading wav file
AUDIO_FILE = '/home/abinash/hin_0044.wav'
input_file = open(AUDIO_FILE)
#!/usr/bin/env python
from __future__ import division
"""
Independent component analysis (ICA) is used to estimate
sources given noisy measurements. Imagine 2 persons speaking
simultaneously and 2 microphones recording the mixed signals.
ICA is used to recover the sources ie. what is said by each person.
"""
#include <shogun/base/init.h>
#include <shogun/features/SparseFeatures.h>
#include <shogun/io/SGIO.h>
#include <shogun/mathematics/Math.h>
#include <shogun/structure/MulticlassSOLabels.h>
#include <shogun/structure/MulticlassModel.h>
#include <shogun/structure/DualLibQPBMSOSVM.h>
#include <shogun/structure/StochasticSOSVM.h>
#include <shogun/labels/BinaryLabels.h>
#include <shogun/labels/MulticlassLabels.h>
@abinashpanda
abinashpanda / so_multilabel.cpp
Last active August 29, 2015 14:02
Multilabel classification using SO framework in shogun.
/*
* This software is distributed under BSD 3-clause license (see LICENSE file).
*
* Copyright(C) 2014 Abinash Panda
* Written(W) 2014 Abinash Panda
*/
#include <shogun/base/init.h>
#include <shogun/evaluation/StructuredAccuracy.h>
#include <shogun/features/SparseFeatures.h>
#include <shogun/io/LineReader.h>
#include <shogun/io/Parser.h>
#include <shogun/lib/DelimiterTokenizer.h>
#include <shogun/lib/SGVector.h>
#include <shogun/lib/SGSparseVector.h>
#include <shogun/io/SGIO.h>
#include <shogun/base/init.h>
using namespace shogun;
#!/usr/bin/env python
"""
Benchmarking test with time taken for multilabel learning using Shogun's
Structured Output (SO) learning framework.
"""
from __future__ import print_function
from __future__ import division
SGSparseVector<float64_t> hash_vector(SGSparseVector<float64_t> vec, int32_t dim,
uint32_t seed)
{
SGVector<float64_t> h_vec(dim);
h_vec.zero();
for (index_t i=0; i<vec.num_feat_entries; i++)
{
uint32_t hash = CHash::MurmurHash3((uint8_t* ) &vec.features[i].feat_index, sizeof (index_t),
seed);
/*
* Copyright(C) 2014 Abinash Panda
* Written(W) 2014 Abinash Panda
*/
#include <shogun/base/init.h>
#include <shogun/lib/Hash.h>
#include <shogun/lib/SGSparseVector.h>
#include <shogun/features/SparseFeatures.h>
#include <shogun/mathematics/Random.h>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.