Skip to content

Instantly share code, notes, and snippets.

View geektoni's full-sized avatar

Giovanni De Toni geektoni

View GitHub Profile
#include <shogun/base/init.h>
#include <shogun/features/DenseFeatures.h>
#include <shogun/labels/RegressionLabels.h>
#include <shogun/kernel/LinearKernel.h>
#include <shogun/regression/KernelRidgeRegression.h>
#include <shogun/evaluation/CrossValidation.h>
#include <shogun/evaluation/CrossValidationSplitting.h>
#include <shogun/evaluation/MeanSquaredError.h>
#include <shogun/lib/parameter_observers/ParameterObserverCV.h>

GSoC 2017 Final Report

Shogun Detox II: Codebase improvements and finalization of the new Tags and Serialization frameworks

Student: Giovanni De Toni
Organization: The Shogun Toolbox
Mentors: Viktor Gal, lambday

Abstract

The Shogun Toolbox is a well-established machine learning project that provides efficient algorithms implementations that can be used in a wide range of applications and with multi-language support (thanks to SWIG magic). Unfortunately, since it was built by many hands for many years, its code has become not easily maintainable or extendable and it does not use many new programming techniques and components that have appeared since the Shogun foundation. The time has come to blow some fresh air (and some new fresh code) into Shogun's depths. This project aims to correct and update the codebase and to complete the integration of

-------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
-------------------------------------------------------------------------------------------------
# Baseline
DataFixture/perceptron_baseline/8/256 16 ms 16 ms 43
DataFixture/perceptron_baseline/64/256 18 ms 18 ms 34
DataFixture/perceptron_baseline/256/256 47 ms 47 ms 15
DataFixture/perceptron_baseline/8/512 31 ms 31 ms 22
DataFixture/perceptron_baseline/64/512 51 ms 51 ms 13
DataFixture/perceptron_baseline/256/512 108 ms 108 ms 6
#!/bin/bash
USER=$1
PASS=$2
usermod --password $(echo $PASS | openssl passwd -1 -stdin) $USER
#include <shogun/features/DenseFeatures.h>
#include <shogun/lib/SGMatrix.h>
#include <shogun/regression/LeastAngleRegression.h>
#include <shogun/labels/RegressionLabels.h>
#include <shogun/mathematics/linalg/LinalgNamespace.h>
#include <shogun/preprocessor/PruneVarSubMean.h>
#include <shogun/preprocessor/NormOne.h>
#include <shogun/lib/parameter_observers/ParameterObserverLogger.h>
#include <shogun/base/init.h>
#include <shogun/lib/common.h>
/******/
/* How observable parameters can be registered*/
/******/
MyFabulousMachine::init()
{
// Register standard parameters
SG_ADD(&m_w, "weights", "Model weigths", ParameterProperties::MODEL);
// Version A: Register observable parameters. The user could then get a list
// (vector) of the parameters he can observe inside this model. Only the parameters
from matplotlib import pyplot as plt
from matplotlib import animation
from shogun import csv_file, features, labels, machine, parameter_observer
f_feats_train = csv_file("classifier_binary_2d_linear_features_train.dat")
f_feats_test = csv_file("classifier_binary_2d_linear_features_test.dat")
f_labels_train = csv_file("classifier_binary_2d_linear_labels_train.dat")
f_labels_test = csv_file("classifier_binary_2d_linear_labels_test.dat")
features_train = features(f_feats_train)
# Beta0 e Beta predetti
0.057167247685
[ 0. -0. -0. 0. 0. -0. -0. 0. -0. 0.]
# Beta0 e Beta reali usati dal generatore
[ 0.04515583]
[-0.012569 0.058881 0.138457 -0.021287 -0.021285 0.143565 0.069767
-0.042679 0.049324 -0.042129]
#include <shogun/base/init.h>
#include <shogun/base/some.h>
#include <shogun/distance/Distance.h>
#include <shogun/features/Features.h>
#include <shogun/io/File.h>
#include <shogun/io/SerializableAsciiFile.h>
#include <shogun/lib/DynamicObjectArray.h>
#include <shogun/lib/SGMatrix.h>
#include <shogun/lib/SGVector.h>
#include <shogun/lib/observers/ParameterObserver.h>
execve("/home/travis/build/BioDynaMo/biodynamo/build/install/third_party/paraview/bin/pvpython", ["pvpython", "../src/core/visualization/genera"..., "output/N3bdm52CatalystAdaptorTes"...], [/* 152 vars */]) = 0
brk(NULL) = 0xbb8000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8d974f4000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/home/travis/build/BioDynaMo/biodynamo/build/install/third_party/qt/lib/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/travis/build/BioDynaMo/biodynamo/build/install/third_party/qt/lib/tls/x86_64", 0x7ffe6b614520) = -1 ENOENT (No such file or directory)
open("/home/travis/build/BioDynaMo/biodynamo/build/install/third_party/qt/lib/tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/travis/build/BioDynaMo/biodynamo/build