Skip to content

Instantly share code, notes, and snippets.

View lambday's full-sized avatar

Soumyajit De lambday

  • Microsoft
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lambday
lambday / test.cpp
Last active October 25, 2019 03:41
TEST(CrossValidationMMD, biased_full)
{
const int32_t seed = 5;
const index_t n=24;
const index_t m=15;
const index_t dim=2;
const index_t num_null_samples=5;
const index_t num_folds=3;
const index_t num_runs=2;
const index_t num_kernels=4;
@lambday
lambday / simd.cpp
Created May 13, 2019 14:13
simd test
// Type your code here, or load an example.
#include <vector>
#include <algorithm>
#include <numeric>
#include <cimmintrin>
using std::vector;
using std::iota;
using std::accumulate;
#include <iostream>
#include <shogun/base/init.h>
#include <shogun/lib/config.h>
#include <shogun/lib/SGMatrix.h>
#include <shogun/base/some.h>
#include <shogun/io/streaming/StreamingFileFromDenseFeatures.h>
#include <shogun/features/DenseFeatures.h>
#include <shogun/features/streaming/generators/MeanShiftDataGenerator.h>
#include <shogun/kernel/GaussianKernel.h>
#include <shogun/statistical_testing/QuadraticTimeMMD.h>
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Maths... Why give a s#!t"
]
},
{
#include <map>
#include <iostream>
#include <functional>
#include <tuple>
#include <memory>
#include <initializer_list>
#include <utility>
namespace std
{
train_feats = sg.RealSparseFeatures('../train.dat')
test_feats = sg.RealSparseFeatures('../test.dat')
train_labels = sg.RealDenseLabels('../train_labels.dat')
gammas = np.arange(1, 10)
lda = sg.LDA()
lda.preprocessor_chain().enque(sg.DimensionSubset()).enque(sg.NormOne()).enque(sg.FisherLDA())
params = sg.ModelSelectionParameters()
@lambday
lambday / tmp.S
Last active December 22, 2016 12:28
main:
mov eax, 409114
ret
@lambday
lambday / obsapi.py
Last active November 27, 2016 00:23
poc api for watchables
# your code goes here
gen_p = GaussianBlobsDataGenerator(...)
gen_q = GaussianBlobsDataGenerator(...)
mmd = QuadraticTimeMMD(gen_p, gen_q)
mmd.set_kernel(GaussianKernel(10, 2**0.5))
mmd.set_num_samples_p(1000)
mmd.set_num_samples_q(1000)
mmd.enable_watching()
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.