Skip to content

Instantly share code, notes, and snippets.

Giovanni De Toni geektoni

Block or report user

Report or block geektoni

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:487fa1c3eac5fbd31c70c9dc54d67fb1
#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>
View results_glm.txt
# 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]
View averaged_perceptron_example.py
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)
View register_observable_params.cpp
/******/
/* 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
View lars_example.cpp
#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>
View changepassword.sh
#!/bin/bash
USER=$1
PASS=$2
usermod --password $(echo $PASS | openssl passwd -1 -stdin) $USER
View Perceptron_Observer_benchmark
-------------------------------------------------------------------------------------------------
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
View GSoC_2017_Final_Report.md

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

View CVobserver_example.cpp
#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>
View backtrace
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007ffff0ea13fa in __GI_abort () at abort.c:89
#2 0x00007ffff0eddbd0 in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7ffff0fd2dd0 "*** Error in `%s': %s: 0x%s ***\n")
at ../sysdeps/posix/libc_fatal.c:175
#3 0x00007ffff0ee3f96 in malloc_printerr (action=3, str=0x7ffff0fd31d8 "malloc(): memory corruption (fast)", ptr=<optimized out>,
ar_ptr=<optimized out>) at malloc.c:5049
#4 0x00007ffff0ee6461 in _int_malloc (av=av@entry=0x7ffff1206b00 <main_arena>, bytes=bytes@entry=7) at malloc.c:3424
#5 0x00007ffff0ee7f34 in __GI___libc_malloc (bytes=7) at malloc.c:2928
#6 0x00007ffff5df91da in (anonymous namespace)::sg_malloc (size=7) at /home/geektoni/shogun/src/shogun/lib/memory.cpp:205
#7 0x00007ffff584fe19 in (anonymous namespace)::sg_generic_malloc<unsigned char> (len=7) at /home/geektoni/shogun/src/shogun/lib/memory.h:91
You can’t perform that action at this time.