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 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
View ObservedValue.h
// Main class (represents a single observed value)
class ObservedValue : public CSGObject
{
ObservedValue();
ObservedValue(int64_t step, std::string name, Any v);
~ObservedValue();
int64_t get_step();
std::string get_name();
View keykeykey
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCS9R0xqyV9L701mLdXgvdAo1eUNWud2Jv6Kc+VgHJReZ/aq+qQxP0eNJhgpL5S0cTqzylBNT8EeSkqSYgtE0aqyaIOAS9cWxkWV9836moXgj0uWqO5UYjpQMVqK93f8ek+NAGbJmvJpBdC9LAN13qM4TAL3Na5Qg1RZI+eX3U7yr+cyfNm38tm+N14v+gJqm6kqbC6zF4s3Rth/vLoG7VnFO2RtA9qNApX/MEprMRZNWDky7IkplnZigSg6FaQ/TGV3ofzoynwg5LEUSiPxM4Sagwt/oOZAk7Q1/0pMeCQkpxBK2B4r0CCJsV6QqiFj6GLQhRxoOLgk674/xUbudr uriel@uriel
View TB_example.cpp
#include <shogun/base/init.h>
#include <shogun/base/some.h>
#include <shogun/labels/BinaryLabels.h>
#include <shogun/lib/SGVector.h>
#include <shogun/lib/Signal.h>
#include <shogun/machine/Machine.h>
#include <shogun/lib/ParameterObserverScalar.h>
#include <shogun/lib/any.h>
#include <vector>
View pause_computation.cpp
#include <shogun/base/init.h>
#include <shogun/base/some.h>
#include <shogun/labels/BinaryLabels.h>
#include <shogun/lib/SGVector.h>
#include <shogun/lib/Signal.h>
#include <shogun/machine/Machine.h>
#include <iostream>
#include <thread>
using namespace shogun;
View handler_example.cpp
#include <shogun/base/init.h>
#include <shogun/base/some.h>
#include <shogun/labels/BinaryLabels.h>
#include <shogun/lib/SGVector.h>
#include <shogun/lib/Signal.h>
#include <shogun/machine/Machine.h>
#include <iostream>
#include <thread>
using namespace shogun;
View Shogun Style Guidelines.md

Shogun Style Guidelines

Shogun is a large project with many contributors and we have decided to define some general coding guidelines which form a "Shogun Standard" which should be followed when writing code for the toolbox. That was made to maintain a clean and polished code-base. Shogun use an automatic style checker (namely Clang Format) to verify if code follows Shogun's coding guidelines. Please make sure that your patches conform to these guidelines, otherwise our Continuous Integration tools will spot these errors and they will mark your pull requests as failed.

You can use our custom script, located in <your_shogun_source_dir>/scripts/check_format.sh to see if the code you have written follows our guidelines. The script will also give you instruction on how to fix style errors. Note that to use the script, clang-format-3.8 must be installed on your system.

Formatting Guidelines

Function Parameters

You can’t perform that action at this time.