This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This program is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation; either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* Written (W) 2011 Heiko Strathmann | |
* Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% samples from N(mu, C) in case type=='cov', and from N(mu, C^(-1)) in case | |
% type=='prec'. z is optional and must be drawn from N(0,I), inds is a | |
% permutations vector that is applied to C before sampling (doesnt effect | |
% the output, just efficiency, smyamd is used as default) | |
function sample=gaussian_sampler_symamd(mu, C, type, z, inds) | |
if nargin<3 | |
type='prec'; | |
end | |
if nargin <4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <shogun/io/streaming/StreamingAsciiFile.h> | |
#include <shogun/features/streaming/StreamingSparseFeatures.h> | |
using namespace shogun; | |
int main(int argc, char *argv[]) | |
{ | |
init_shogun(); | |
CStreamingAsciiFile *file=new CStreamingAsciiFile("trivial-crash-example.dat"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from numpy.ma.core import reshape, mean | |
from shogun.Features import RegressionLabels, RealFeatures | |
from shogun.Regression import LeastAngleRegression, LinearRidgeRegression, LeastSquaresRegression | |
from shogun.Evaluation import CrossValidation, CrossValidationResult, \ | |
CrossValidationSplitting, MeanSquaredError | |
import time | |
n=250 | |
n_class=6 | |
dim=274 * 100 * 12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This program is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation; either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* Written (W) 2013 Heiko Strathmann | |
*/ | |
#include <shogun/lib/config.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This program is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation; either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* Written (W) 2013 Heiko Strathmann | |
*/ | |
#include <shogun/lib/config.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [V,colours] = probe( colours) | |
%% function [V] = probe(A,p) | |
% Creates a probing matrix based on a graph colouring of A using the | |
% algorithm in "J. Tang and Y. Saad, A probing method for computing the diagonal of the matrix | |
% inverse" (2010). | |
% | |
% REQUIRES: Matgraph toolbox http://www.ams.jhu.edu/~ers/matgraph/ | |
% | |
% Input: colours - A graph colouring (of A^p probably) | |
% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [d,V] = det_Krylov_preconditioned(A,P,precomputed, tol,maxiter) | |
n = length(A); | |
V = probe(precomputed.colouring); | |
d= 0.0; | |
parfor iii=1:size(V,2) | |
workerNo = get(getCurrentTask,'ID'); | |
fprintf('det_Krylov_preconditioned %d/%d\n', iii, size(V,2)); | |
[tmp,iter]=ratKrylov01_preconditioned(A,V(:,iii),P,precomputed.wsq,precomputed.dzdt,precomputed.const,tol,maxiter); | |
d = d + V(:,iii)'*tmp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This program is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation; either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* Written (W) 2013 Heiko Strathmann | |
*/ | |
#include <shogun/lib/config.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "shogun_gp_classification" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
OlderNewer