Skip to content

Instantly share code, notes, and snippets.

View sanuj's full-sized avatar

Sanuj Sharma sanuj

View GitHub Profile
@sanuj
sanuj / gist:77c177806f2dd8ada8cc
Created December 2, 2014 16:29
output on "cmake -DENABLE_TESTING=ON"
sanuj@sanuj-VAIO:~/git-reps/shogun/build-debug$ cmake -DENABLE_TESTING=ON ..
-- Could NOT find CCache (missing: CCACHE)
-- Using system's malloc
-- Could NOT find MOSEK (missing: MOSEK_DIR MOSEK_INCLUDE_DIR MOSEK_LIBRARY)
-- A library with BLAS API found.
-- A library with LAPACK API found.
-- Could NOT find ATLAS (missing: ATLAS_INCLUDES)
-- Could NOT find GLPK (missing: GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_PROPER_VERSION_FOUND)
-- Could NOT find CPLEX (missing: CPLEX_LIBRARY CPLEX_INCLUDE_DIR)
-- Could NOT find Eigen3 (missing: EIGEN_INCLUDE_DIR) (Required is at least version "3.1.2")
@sanuj
sanuj / dot_comparison.cpp
Last active August 29, 2015 14:15
Shogun Dot Comparison - Native vs Eigen3
#include <hayai.hpp>
#include <shogun/mathematics/linalg/linalg.h>
using namespace shogun;
using namespace std;
const index_t size=1000;
SGVector<float64_t> a(size), b(size);
void initialize() {
@sanuj
sanuj / parser.cpp
Created March 7, 2015 17:19
Read/Write vectors of OpenCV Points.
#include <vector>
#include <string>
#include <fstream>
#include <iostream>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
@sanuj
sanuj / better_parser.cpp
Created March 10, 2015 12:41
Better Read/Writer vectors of OpenCV Points.
#include <vector>
#include <string>
#include <fstream>
#include <iostream>
#include <climits>
#include <opencv2/opencv.hpp>
#define DELIMITERS " \t,[]{}:\"abcdefghijklmnopqrstuvwz`~!@#$%^&*()_=+\\|;'?/.<>"
using namespace std;
@sanuj
sanuj / base_64.cpp
Last active August 29, 2015 14:17
Base 64 encoding and decoding. It's currently set for encoding. If you want to decode then comment encode and uncomment decode. You will also have to swap the input and output text files.
#include <stdlib.h>
#include <stdio.h>
const char base_64_arr[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
const char decode_arr[]="|&&&}rstuvwxyz{&&&&&&&>?@ABCDEFGHIJKLMNOPQRSTUVW&&&&&&XYZ[\\]^_`abcdefghijklmnopq";
void decode(FILE *f_in, FILE *f_out)
{
int i, len, ch;
@sanuj
sanuj / TestSet.mat
Last active August 29, 2015 14:17
Example on regression using python.
4d41 544c 4142 2035 2e30 204d 4154 2d66
696c 652c 2050 6c61 7466 6f72 6d3a 2050
4357 494e 2c20 4372 6561 7465 6420 6f6e
3a20 4672 6920 4665 6220 3036 2031 383a
3534 3a34 3120 3230 3135 2020 2020 2020
2020 2020 2020 2020 2020 2020 2020 2020
2020 2020 2020 2020 2020 2020 2020 2020
2020 2020 0000 0000 0000 0000 0001 494d
0f00 0000 9902 0000 789c 3593 3f6c d340
14c6 9d34 ce1f 8726 4ee2 3889 1ddb 6b99
@sanuj
sanuj / neural_nets_basics.cpp
Created May 3, 2015 18:25
neural nets basics
#include <shogun/base/init.h>
#include <iostream>
#include <shogun/io/SGIO.h>
#include <shogun/lib/common.h>
#include <shogun/mathematics/Math.h>
#include <shogun/features/DataGenerator.h>
#include <shogun/features/DenseFeatures.h>
#include <shogun/labels/MulticlassLabels.h>
#include <shogun/evaluation/MulticlassAccuracy.h>
@sanuj
sanuj / gist:4994d1d8feccdf069400
Created May 6, 2015 14:57
classes=2, features=2, 3 layers including input and output.
[DEBUG] Entering
[DEBUG] Leaving
[DEBUG] Entering
[DEBUG] Leaving
[DEBUG] Entering
[DEBUG] Leaving
[DEBUG] Entering
[DEBUG] Leaving
[DEBUG] Entering
[DEBUG] Leaving
Running tests...
Test project /home/sanuj/Projects/shogun/build
Start 1: unit-KernelDensity
1/501 Test #1: unit-KernelDensity ......................................................... Passed 0.03 sec
Start 2: unit-StochasticGBMachine
2/501 Test #2: unit-StochasticGBMachine ................................................... Passed 0.06 sec
Start 3: unit-SplittingStrategy
3/501 Test #3: unit-SplittingStrategy ..................................................... Passed 0.04 sec
Start 4: unit-ROCEvaluation
4/501 Test #4: unit-ROCEvaluation ......................................................... Passed 0.02 sec
-- Using system's malloc
-- Could NOT find MOSEK (missing:  MOSEK_DIR MOSEK_INCLUDE_DIR MOSEK_LIBRARY) 
-- A library with BLAS API found.
-- A library with LAPACK API found.
-- Could NOT find GLPK (missing:  GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_PROPER_VERSION_FOUND) 
-- Could NOT find CPLEX (missing:  CPLEX_LIBRARY CPLEX_INCLUDE_DIR) 
-- Could NOT find OPENCL (missing:  OPENCL_LIBRARY) 
-- Looking for viennacl::ocl::type_to_string<char>::apply
-- Looking for viennacl::ocl::type_to_string<char>::apply - not found