plateform stringclasses 1
value | repo_name stringlengths 13 113 | name stringlengths 3 74 | ext stringclasses 1
value | path stringlengths 12 229 | size int64 23 843k | source_encoding stringclasses 9
values | md5 stringlengths 32 32 | text stringlengths 23 843k |
|---|---|---|---|---|---|---|---|---|
github | aadilh/heli-deep-q-master | disconnectAgent.m | .m | heli-deep-q-master/simulator/system/codecs/Matlab/src/agent/disconnectAgent.m | 1,353 | utf_8 | fc334ec829325038ecd5f96cbcc744d4 | % Copyright 2008 Brian Tanner
% http://rl-glue-ext.googlecode.com/
% brian@tannerpages.com
% http://research.tannerpages.com
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% ... |
github | aadilh/heli-deep-q-master | runAgentLoop.m | .m | heli-deep-q-master/simulator/system/codecs/Matlab/src/agent/runAgentLoop.m | 4,787 | utf_8 | 863ad387e37958ded75f8eaf174bebcd | % Copyright 2008 Brian Tanner
% http://rl-glue-ext.googlecode.com/
% brian@tannerpages.com
% http://research.tannerpages.com
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% ... |
github | aadilh/heli-deep-q-master | test_1_environment.m | .m | heli-deep-q-master/simulator/system/codecs/Matlab/src/tests/test_1_environment.m | 3,357 | utf_8 | 076c4d8ea544104bd6f6153c760ae368 | % Copyright 2008 Brian Tanner
% http://rl-glue-ext.googlecode.com/
% brian@tannerpages.com
% http://research.tannerpages.com
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% ... |
github | aadilh/heli-deep-q-master | test_empty_agent.m | .m | heli-deep-q-master/simulator/system/codecs/Matlab/src/tests/test_empty_agent.m | 2,602 | utf_8 | 8c592ddde0a74bfaeb5c31a485a4d0e1 | % Copyright 2008 Brian Tanner
% http://rl-glue-ext.googlecode.com/
% brian@tannerpages.com
% http://research.tannerpages.com
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% ... |
github | aadilh/heli-deep-q-master | test_speed_environment.m | .m | heli-deep-q-master/simulator/system/codecs/Matlab/src/tests/test_speed_environment.m | 3,501 | utf_8 | 4e3fa63611192ecf7ce40219b4afaeef | % Copyright 2008 Brian Tanner
% http://rl-glue-ext.googlecode.com/
% brian@tannerpages.com
% http://research.tannerpages.com
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% ... |
github | aadilh/heli-deep-q-master | test_message_agent.m | .m | heli-deep-q-master/simulator/system/codecs/Matlab/src/tests/test_message_agent.m | 2,051 | utf_8 | 935b840a99b6390d18b9963c1a991f39 | % Copyright 2008 Brian Tanner
% http://rl-glue-ext.googlecode.com/
% brian@tannerpages.com
% http://research.tannerpages.com
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% ... |
github | aadilh/heli-deep-q-master | test_sanity_experiment.m | .m | heli-deep-q-master/simulator/system/codecs/Matlab/src/tests/test_sanity_experiment.m | 1,672 | utf_8 | f7315bcb6e5e1ec285e6af130c39d2d5 | % Copyright 2008 Brian Tanner
% http://rl-glue-ext.googlecode.com/
% brian@tannerpages.com
% http://research.tannerpages.com
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% ... |
github | aadilh/heli-deep-q-master | test_empty_environment.m | .m | heli-deep-q-master/simulator/system/codecs/Matlab/src/tests/test_empty_environment.m | 2,835 | utf_8 | 4fb2f8f493e487f46642eb0b0212f54c | % Copyright 2008 Brian Tanner
% http://rl-glue-ext.googlecode.com/
% brian@tannerpages.com
% http://research.tannerpages.com
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% ... |
github | aadilh/heli-deep-q-master | test_rl_episode_experiment.m | .m | heli-deep-q-master/simulator/system/codecs/Matlab/src/tests/test_rl_episode_experiment.m | 3,023 | utf_8 | a422cb70532b143cc33815a43dfcad1a | % Copyright 2008 Brian Tanner
% http://rl-glue-ext.googlecode.com/
% brian@tannerpages.com
% http://research.tannerpages.com
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% ... |
github | aadilh/heli-deep-q-master | test_1_agent.m | .m | heli-deep-q-master/simulator/system/codecs/Matlab/src/tests/test_1_agent.m | 2,613 | utf_8 | 188a4d84fb6bfe1da8b544776217478c | % Copyright 2008 Brian Tanner
% http://rl-glue-ext.googlecode.com/
% brian@tannerpages.com
% http://research.tannerpages.com
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% ... |
github | aadilh/heli-deep-q-master | runAllTests.m | .m | heli-deep-q-master/simulator/system/codecs/Matlab/src/tests/runAllTests.m | 1,152 | utf_8 | 3041b975f9b253268e8130143ba908e2 | function runAllTests()
theTests=[];
testsanity.agent=test_1_agent();
testsanity.environment=test_1_environment();
testsanity.experiment=@test_sanity_experiment;
test1.agent=test_1_agent();
test1.environment=test_1_environment();
test1.experiment=@test_1_experiment;
testempty.agent... |
github | aadilh/heli-deep-q-master | test_message_environment.m | .m | heli-deep-q-master/simulator/system/codecs/Matlab/src/tests/test_message_environment.m | 2,337 | utf_8 | 3c473e32a10582feb5e853687e32da03 | % Copyright 2008 Brian Tanner
% http://rl-glue-ext.googlecode.com/
% brian@tannerpages.com
% http://research.tannerpages.com
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% ... |
github | aadilh/heli-deep-q-master | test_message_experiment.m | .m | heli-deep-q-master/simulator/system/codecs/Matlab/src/tests/test_message_experiment.m | 3,532 | utf_8 | 09a7b9c7107edfcea14449a334c844f2 | % Copyright 2008 Brian Tanner
% http://rl-glue-ext.googlecode.com/
% brian@tannerpages.com
% http://research.tannerpages.com
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% ... |
github | aadilh/heli-deep-q-master | test_speed_environment_run.m | .m | heli-deep-q-master/simulator/system/codecs/Matlab/src/tests/test_speed_environment_run.m | 1,064 | utf_8 | 260e112b01452ca5dd198dbd6b8f23fa | % Copyright 2008 Brian Tanner
% http://rl-glue-ext.googlecode.com/
% brian@tannerpages.com
% http://research.tannerpages.com
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% ... |
github | aadilh/heli-deep-q-master | test_1_experiment.m | .m | heli-deep-q-master/simulator/system/codecs/Matlab/src/tests/test_1_experiment.m | 6,086 | utf_8 | a361a3a8f5549cc04a629fd2cc1610f7 | % Copyright 2008 Brian Tanner
% http://rl-glue-ext.googlecode.com/
% brian@tannerpages.com
% http://research.tannerpages.com
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% ... |
github | aadilh/heli-deep-q-master | test_empty_experiment.m | .m | heli-deep-q-master/simulator/system/codecs/Matlab/src/tests/test_empty_experiment.m | 4,624 | utf_8 | 2efc6bd1df417b847a4bb084dc79746b | % Copyright 2008 Brian Tanner
% http://rl-glue-ext.googlecode.com/
% brian@tannerpages.com
% http://research.tannerpages.com
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% ... |
github | sushil-bharati/EasyExtract-master | gt_to_xywh.m | .m | EasyExtract-master/gt_to_xywh.m | 418 | utf_8 | 26ec3516dfbe5ea8d538eca08b878db0 | %This function was designed by Mr. Sushil Bharati on Oct 21, 2016
% The aim of this function is to convert x1,y1,x2,y2 to x1,y1,width,height
% format
function gt_to_xywh
file1 = fopen('youtube_1.txt','r');
file2 = fopen('youtube_1_gt.txt','w');
while true
line = fgetl(file1);
if ~ischar(line)
break
end
[A] = ... |
github | ilya-palachev/polyhedra-correction-library-master | pdcoLSprimal.m | .m | polyhedra-correction-library-master/Source/Matlab/pdcoLSprimal.m | 3,749 | utf_8 | a67e79caffaa54252bbfaf4e064864eb | function [h,u,v,rnorm] = pdcoLSprimal( Q,h0 )
% [h,u,v,rnorm] = pdcoLSprimal( Q,h0 );
% solves the constrained least squares problem
%
% min ||h-h0||^2 st Q*h >= 0
%
% by applying PDCO to the regularized primal problem
%
% min 1/2 ||h-h0||^2 + 1/2 ||d1*h||^2 + 1/2 ||d1*s||^2 + 1/2 ||r||^2
% h,s,r
% st ... |
github | ilya-palachev/polyhedra-correction-library-master | pdcotestLP.m | .m | polyhedra-correction-library-master/Source/Matlab/pdco4/code/pdcotestLP.m | 2,931 | utf_8 | 453bdea02edadb4526d6cd42278ea619 | function pdcotestLP( m,n )
% m=50; n=100; pdcotestLP( m,n );
% Generates a random m by n LP problem
% min c'x st. Ax = b, bl < x < bu,
% and runs it on pdco.m.
%-----------------------------------------------------------------------
% 08 Oct 2002: Simple test program for pdco.m.
% "A" is an explicit... |
github | ilya-palachev/polyhedra-correction-library-master | pdcotestQP.m | .m | polyhedra-correction-library-master/Source/Matlab/pdco4/code/pdcotestQP.m | 3,495 | utf_8 | fac4dbe3b3fe47e119b7dd12e20c21f2 | function pdcotestQP( m,n )
% m=50; n=100; pdcotestQP( m,n );
% Generates a random m by n QP problem
% min x'Hx + c'x st. Ax = b, bl < x < bu,
% and runs it on pdco.m.
%-----------------------------------------------------------------------
% 08 Oct 2002: Simple test program for pdco.m.
% "A" is an ex... |
github | ilya-palachev/polyhedra-correction-library-master | pdcotestBPDN.m | .m | polyhedra-correction-library-master/Source/Matlab/pdco4/code/pdcotestBPDN.m | 4,057 | utf_8 | 5cb027b15c2cba0da0beeb5c5614926e | function pdcotestBPDN( m,n,k,lambda )
% m=50; n=100; k = 10; lambda=1e-3; pdcotestBPDN( m,n,k,lambda );
% Generates a random m by n basis pursuit denoising problem (BPDN)
% with k non zeros in the optimal solution, and treats the constraint matrix
% A as an operator. (We need k <= n.)
%
% BPDN is the problem
% ... |
github | ilya-palachev/polyhedra-correction-library-master | pdcotestLS.m | .m | polyhedra-correction-library-master/Source/Matlab/pdco4/code/pdcotestLS.m | 3,512 | utf_8 | 9716955c03ba9b5ee2c5abcdab6be989 | function pdcotestLS( m,n,nc )
% m=50; n=100; nc = 10; pdcotestLS( m,n,nc );
% Generates a random m by n Weighted Least Squares problem
% with the last nc rows as linear constraints, and runs it on pdco.m.
% (We need nc <= m.)
%
% The problem is treated as
%
% minimize c'x + 1/2 ||D1*x||^2 + 1/2 ||r||^2
% ... |
github | ilya-palachev/polyhedra-correction-library-master | minres.m | .m | polyhedra-correction-library-master/Source/Matlab/pdco4/code/minres.m | 14,490 | utf_8 | 66ed8fe84926284b5cc3bd3a7f59810f | function [ x, istop, itn, rnorm, Arnorm, Anorm, Acond, ynorm ] = ...
minres( A, b, M, shift, show, check, itnlim, rtol )
% [ x, istop, itn, rnorm, Arnorm, Anorm, Acond, ynorm ] = ...
% minres( A, b, M, shift, show, check, itnlim, rtol )
%
% minres solves the n x n system of linear equations ... |
github | ilya-palachev/polyhedra-correction-library-master | pdco.m | .m | polyhedra-correction-library-master/Source/Matlab/pdco4/code/pdco.m | 56,279 | utf_8 | 2603a74eec5c5b19c4517476e2ae1ddb | function [x,y,z,inform,PDitns,CGitns,time] = ...
pdco(pdObj,pdMat,b,bl,bu,d1,d2,options,x0,y0,z0,xsize,zsize)
%-----------------------------------------------------------------------
% pdco.m: Primal-Dual Barrier Method for Convex Objectives (23 Nov 2013)
%----------------------------------------------------------... |
github | kkurkela/KyleSPMToolbox-master | EstimateModel.m | .m | KyleSPMToolbox-master/Models/EstimateModel.m | 9,336 | utf_8 | ad1449174e5a71f86b4d76e80cac2dfb | function [] = EstimateModel()
% EstimateModel function for estimating a GLM specified using the
% SpecifyModel. Allows user to display the
% trial type onsets/durations in the SPM Batch GUI
%
% Assumes SpecifyModel.m has been run.
%
% Assumes that files are organized as f... |
github | kkurkela/KyleSPMToolbox-master | EstimateModelBIDS.m | .m | KyleSPMToolbox-master/Models/EstimateModelBIDS.m | 12,603 | utf_8 | ef810b88f7332f6c07626d9d830142ce | function [] = EstimateModel()
% EstimateModel function for estimating a GLM specified using the
% SpecifyModel. Allows user to display the
% trial type onsets/durations in the SPM Batch GUI
%
% Assumes SpecifyModel.m has been run.
%
% See also: SpecifyModel
%% User Input... |
github | kkurkela/KyleSPMToolbox-master | SpecifyModel.m | .m | KyleSPMToolbox-master/Models/SpecifyModel.m | 16,249 | utf_8 | 52d957e2c8b710bbb17fd0786d9725c5 | function [] = SpecifyModel()
% SpecifyModel function designed to build multiple conditions files
% for later use with SPM's matlabbatch system
%
% This function takes no input. All relevenat variables are defined
% within the body of this function.
%
% Assumes that the behavioral da... |
github | PhanLeSon03/Audio_Record_MFCC_Spectrum-master | MFCC.m | .m | Audio_Record_MFCC_Spectrum-master/MFCC_Matlab/MFCC.m | 1,490 | utf_8 | 9a379b0a3899782f4e1c60d80789b367 | function Out = MFCC(Sample, FilterBank, fNorm, FIRCoef)
%In = Preemphasis(Sample);
In = Sample;
In = In.*FIRCoef;
In_fft = fft(In);
In_fft_abs = abs(In_fft);
spectrum = GetMFCC(In_fft_abs, FilterBank, fNorm );
Out = spectrum;
%Out = lifter(spectrum);
end
%%
function Out= Preemphasis(In)
Out = ... |
github | PhanLeSon03/Audio_Record_MFCC_Spectrum-master | PreCalcFilterBank.m | .m | Audio_Record_MFCC_Spectrum-master/MFCC_Matlab/PreCalcFilterBank.m | 1,740 | utf_8 | 221277dbabf9a8981cf24aab7e63ec37 | function [FilterBank, fNorm, FIRCoef, Mel_Fre] = PreCalcFilterBank(N_2, N_BANK, FS)
FIRCoef = hanning(2*N_2);
FilterBank = zeros(N_BANK-1,N_2);
fNorm = zeros(N_BANK-1,1);
Mel_Fre = zeros(N_BANK+1,1);
Mel_Fre(1) = 0;
for iBank = 2: N_BANK+1
Mel_Fre(iBank) = GetCenterFrequency(iBank,F... |
github | hasantahir/Michalski-Algos-master | cpv.m | .m | Michalski-Algos-master/cpv.m | 2,004 | utf_8 | 858b72bc298a86069738c700515759d4 | % Evaluates the CPV integral of a user supplied function phi(x)
% over (a,b) at the point x0 in (a,b)
% by a n-point Double Epxponential (DE) scheme.
% The integal defintion is integral with respect to x over (a,b ) of phi(x) /(x-x0).
% Double Exponential transformation between x & u is given by
% x= (b+a)/2 + (b-a)... |
github | hasantahir/Michalski-Algos-master | funct_overloaded.m | .m | Michalski-Algos-master/funct_overloaded.m | 2,214 | utf_8 | 89fc0b04b67e8758ab51ee9a0b68c655 | <<<<<<< HEAD
function y = funct_overloaded(varargin)
=======
function y = funct(varargin)
>>>>>>> master
% This function implements integrand of I_1(\rho)
% Courtesy of Mazin M Mustafa
switch nargin
% Two arguments in the input. This is the normal case
case 2
c = varargin{1};
d = var... |
github | hasantahir/Michalski-Algos-master | besselzero.m | .m | Michalski-Algos-master/besselzero.m | 1,359 | utf_8 | 3b98491a78af853c3f409ee89d6923c2 | function x=besselzero(n,~,k,kind)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% besselzero.m
%
% Find first k positive zeros of the Bessel function J(n,x) or Y(n,x)
% using Halley's method.
%
% Written by: Greg von Winckel - 01/25/05
% Contact: gregvw(at)chtm(dot)unm(dot)edu
%
%%%%%%... |
github | hasantahir/Michalski-Algos-master | brewermap.m | .m | Michalski-Algos-master/VED examples/brewermap.m | 17,088 | utf_8 | b71e8df9e23b715ae641fd43a4a35e07 | function [map,num,typ] = brewermap(N,scheme)
% The complete selection of ColorBrewer colorschemes (RGB colormaps).
%
% (c) 2015 Stephen Cobeldick
%
% Returns any RGB colormap from the ColorBrewer colorschemes, especially
% intended for mapping and plots with attractive, distinguishable colors.
%
% Syntax (basic):
% ma... |
github | hasantahir/Michalski-Algos-master | brewermap.m | .m | Michalski-Algos-master/HED examples/brewermap.m | 17,088 | utf_8 | b71e8df9e23b715ae641fd43a4a35e07 | function [map,num,typ] = brewermap(N,scheme)
% The complete selection of ColorBrewer colorschemes (RGB colormaps).
%
% (c) 2015 Stephen Cobeldick
%
% Returns any RGB colormap from the ColorBrewer colorschemes, especially
% intended for mapping and plots with attractive, distinguishable colors.
%
% Syntax (basic):
% ma... |
github | MednickLab/YettiToolBox-master | linearSlopeParams.m | .m | YettiToolBox-master/analysis/linearSlopeParams.m | 270 | utf_8 | eaa47772659f37ffc81f89f45364694a | %return linear fit and r2 fit stat
function [slope,inter,r2] = linearSlopeParams(x,y)
st1 = regstats(y,x,'linear','tstat');
slope = st1.tstat.beta(2);
inter = st1.tstat.beta(1);
st2 = regstats(y,x,'linear','rsquare');
r2 = st2.rsquare;
end |
github | MednickLab/YettiToolBox-master | hypnogram.m | .m | YettiToolBox-master/analysis/hypnogram.m | 11,965 | utf_8 | f16836391392d1901dd8dd865bc61e76 | % Function takes in a cell array with 1-3 cells (below in order)
% Cell #1 is always neccesary, this should contain epcohStage sets (1 or more)
% Cell #2 should contain epochStartTime sets (# of sets should be <= stage sets)
% Cell #3: An int (1-4) that specifies what you want to use on the X-Axis (optional)
% ... |
github | MednickLab/YettiToolBox-master | radarPlot.m | .m | YettiToolBox-master/analysis/radarPlot.m | 2,328 | utf_8 | 78f9201ad63e1439e625107831cb03d7 | % RADARPLOT spiderweb or radar plot
% radarPlot(P) Make a spiderweb or radar plot using the columns of P as datapoints.
% P is the dataset. The plot will contain M dimensions(or spiderweb stems)
% and N datapoints (which is also the number of columns in P). Returns the
% axes handle
%
% radarPlot(P, ..., lineP... |
github | MednickLab/YettiToolBox-master | slopeParams.m | .m | YettiToolBox-master/analysis/slopeParams.m | 649 | utf_8 | e09f49ed672726ddc132ee94b683d800 | %Find slope and intercept of multi-level data
function [slope,inter] = slopeParams(data,colorChange) %TODO plotting....
colors = {'r','b','k','c','m'};
slope = nan(size(data));
inter = nan(size(data));
hold on
for i=1:length(data)
y = data{i};
if sum(~isnan(y))<=4; continue; ... |
github | cronelab/webfm-main | ExtractSensorLoc.m | .m | webfm-main/utils/matlab/ExtractSensorLoc.m | 16,793 | utf_8 | fe7acba72fe6468bc5e8b39923df6bd1 | function varargout = ExtractSensorLoc(varargin)
% EXTRACTSENSORLOC MATLAB code for ExtractSensorLoc.fig
% EXTRACTSENSORLOC, by itself, creates a new EXTRACTSENSORLOC or raises the existing
% singleton*.
%
% H = EXTRACTSENSORLOC returns the handle to a new EXTRACTSENSORLOC or the handle to
% the exis... |
github | wtconlin/InertialSensors-master | ComplementaryFilter.m | .m | InertialSensors-master/ComplementaryFilter.m | 4,758 | utf_8 | 9f2987ea2ba9f9124f2013b95a160ed5 | % Will Conlin, 4/11/17
% Complementary Filter
% Inputs: Simulated IMU data
% Models: State dynamics, error, complementary filter
% Units: m/s^2 and radians
% Instructions: A call would look like:
% ComplementaryFilter(simulatedData(5,1)) where the 1 is to close plots
function gamma = ComplementaryFilter(simimu,varar... |
github | wtconlin/InertialSensors-master | Madgwick.m | .m | InertialSensors-master/Madgwick.m | 4,058 | utf_8 | b6d5343f1f3e04d238c907c50872c6ec | % Will Conlin, 4/11/17
% Madgwick Complementary Filter
% Inputs: Simulated IMU data
% Models: State dynamics, error, complementary filter
% Units: m/s^2 and radians
% Instructions: A call would look like:
% Madgwick(simulatedData(5,1)) where the 1 is to close plots
function gamma = Madgwick(simimu,varargin)
% simimu... |
github | wtconlin/InertialSensors-master | filterMadgwick.m | .m | InertialSensors-master/filterMadgwick.m | 11,750 | utf_8 | 10d77c773ea345ee0ac9b34771e3959b | % From tytell
function results = filterMadgwick(imu, varargin)
% Options - default
opt.type = 'complementary'; % or 'kalman'
opt.alphabybeta = 10;
opt.twindow = 125;
opt.zeta = 0.95;
opt.filtertime = [-Inf Inf];
%add kalman filter parameters here
opt = parsevararg... |
github | wtconlin/InertialSensors-master | get_orient_imu.m | .m | InertialSensors-master/get_orient_imu.m | 4,256 | utf_8 | 63f67bb2c2ffac50d43c5691f6921dbe | function imu = get_orient_imu(imu, varargin)
opt.method = 'simple';
opt.gyrooffset = [-16 -8];
opt.gyroband = [0.1 10];
opt.getoffset = true;
% opt = parsevarargin(opt,varargin,2);
imu.rate = 1/mean(diff(imu.t));
%ideally we want a bandpass, but matlab doesn't do well with very
%low cutoffs, so we do a running mean... |
github | wtconlin/InertialSensors-master | simulatedData.m | .m | InertialSensors-master/simulatedData.m | 8,054 | utf_8 | 87c27054fda994902e9d07325543ab10 | % This function generates simulated IMU data of a virtual fish
function [simimu] = simulatedData(timelength,varargin)
Aamp = 0;
if(not(isempty(varargin)))
for ii=1:2:length(varargin)
if(strcmp(varargin(ii),'Aamp'))
Aamp = cell2mat(varargin(ii+1));
end
end
end
% keyboard
calibmillise... |
github | dtbinh/formation_control_3D-master | graph_create.m | .m | formation_control_3D-master/graph_create.m | 3,946 | utf_8 | 8624b473d2653e9c9ff836062facdc37 | function [A_c, A_c_2, A, A_2] = graph_create(connections, connections2, N)
%creates two random graphs using Erdos-Renyi-Algorithm of n-vehicles and
%finds minimum directed spanning tree of these two graphs
%
% Inputs:
% N - number of vehicles
% connections - to leader connected vehicles in graph 1
%... |
github | liyangliu/deepid-master | classification_demo.m | .m | deepid-master/matlab/demo/classification_demo.m | 5,412 | utf_8 | 8f46deabe6cde287c4759f3bc8b7f819 | function [scores, maxlabel] = classification_demo(im, use_gpu)
% [scores, maxlabel] = classification_demo(im, use_gpu)
%
% Image classification demo using BVLC CaffeNet.
%
% IMPORTANT: before you run this demo, you should download BVLC CaffeNet
% from Model Zoo (http://caffe.berkeleyvision.org/model_zoo.html)
%
% *****... |
github | chrisjmccormick/hog_matlab-master | imresize.m | .m | hog_matlab-master/graphics/imresize.m | 8,041 | utf_8 | 3ca31d4a247d4e552c4e55650d1f9f8a | function [rout,g,b] = imresize(varargin)
%IMRESIZE Resize image.
% B = IMRESIZE(A,M,'method') returns an image matrix that is
% M times larger (or smaller) than the image A. The image B
% is computed by interpolating using the method in the string
% 'method'. Possible methods are 'nearest' (nearest neighbor)... |
github | chrisjmccormick/hog_matlab-master | train_svm.m | .m | hog_matlab-master/svm/train_svm.m | 852 | utf_8 | d6e06b0cb9dc8483a85dae90d0dada4a | function theta = train_svm(trainXC, trainY, C)
numClasses = max(trainY);
w0 = zeros(size(trainXC,2)*numClasses, 1);
w = minFunc(@my_l2svmloss, w0, struct('MaxIter', 1000, 'MaxFunEvals', 1000), ...
trainXC, trainY, numClasses, C);
theta = reshape(w, size(trainXC,2), numClasses);
% 1-vs-all L... |
github | chrisjmccormick/hog_matlab-master | WolfeLineSearch.m | .m | hog_matlab-master/svm/minFunc/WolfeLineSearch.m | 11,023 | utf_8 | e78201dab344cc6fa1a101af3e1e8eec | function [t,f_new,g_new,funEvals,H] = WolfeLineSearch(...
x,t,d,f,g,gtd,c1,c2,LS,maxLS,tolX,debug,doPlot,saveHessianComp,funObj,varargin)
%
% Bracketing Line Search to Satisfy Wolfe Conditions
%
% Inputs:
% x: starting location
% t: initial step size
% d: descent direction
% f: function value at starting lo... |
github | chrisjmccormick/hog_matlab-master | minFunc_processInputOptions.m | .m | hog_matlab-master/svm/minFunc/minFunc_processInputOptions.m | 3,551 | utf_8 | ea7fbcf303b9cafeca4045921adad934 |
function [verbose,verboseI,debug,doPlot,maxFunEvals,maxIter,tolFun,tolX,method,...
corrections,c1,c2,LS_init,LS,cgSolve,qnUpdate,cgUpdate,initialHessType,...
HessianModify,Fref,useComplex,numDiff,LS_saveHessianComp,...
DerivativeCheck,Damped,HvFunc,bbType,cycle,...
HessianIter,outputFcn,useMex,useNegCu... |
github | tonyabracadabra/Factorization-Machine-10725-master | optimize_model2.m | .m | Factorization-Machine-10725-master/yanyu_code/optimize_model2.m | 8,599 | utf_8 | a3c032db43697298e15f22f685bea9e3 | %% auther: Yanyu Liang
%% contact: yanyul@andrew.cmu.edu
%% time: 12/04/2016
%% project: Factorization Machines
%% Task: Model 2 - convex FMs
%% Description:
% L = |y - \hat{y}|^2 + lambda1 * |W|_tr + lambda2 * |vec(W)|_1 + lambda3 * |w|_2^2 + lambda4 * |w|_1
% \hat{y} = w0 + w' * x + x' * W * x
%% Algorithms:
% 1.... |
github | tonyabracadabra/Factorization-Machine-10725-master | optimize_model2_v2.m | .m | Factorization-Machine-10725-master/yanyu_code/optimize_model2_v2.m | 11,277 | utf_8 | ca027094a6e09bc03f91ecc9007185e4 | %% auther: Yanyu Liang
%% contact: yanyul@andrew.cmu.edu
%% time: 12/08/2016
%% project: Factorization Machines
%% Task: Model 2 - convex FMs - v2
%% Description:
% L = |y - \hat{y}|^2 + lambda1 * |W|_tr + lambda2 * |vec(W)|_1 + lambda3 * |w|_2^2
% \hat{y} = w0 + w' * x + x' * W * x
%% Algorithms:
% 1. ADMM: |y - \... |
github | tonyabracadabra/Factorization-Machine-10725-master | optimize_model2_v2_for_argmin_w0wW.m | .m | Factorization-Machine-10725-master/yanyu_code/optimize_model2_v2_for_argmin_w0wW.m | 12,665 | utf_8 | 3ad7d59b6f8f735cdcff6b425c2d4808 | %% auther: Yanyu Liang
%% contact: yanyul@andrew.cmu.edu
%% time: 12/08/2016
%% project: Factorization Machines
%% Task: Model 2 - convex FMs - v2
%% Description:
% L = |y - \hat{y}|^2 + lambda1 * |W|_tr + lambda2 * |vec(W)|_1 + lambda3 * |w|_2^2
% \hat{y} = w0 + w' * x + x' * W * x
%% Algorithms:
% 1. ADMM: |y - \... |
github | tonyabracadabra/Factorization-Machine-10725-master | test_ADMM.m | .m | Factorization-Machine-10725-master/yanyu_code/test_ADMM.m | 2,993 | utf_8 | b5ecb591925d69a44ed1fa7ea61b22fb | %% ADMM
% compare convergence rate of proximal gradient and coordinate descent
function [objs_coors,objs_proxs, objs_quasis] = test_ADMM(datatype, p)
opt_model2 = optimize_model2_v2_for_argmin_w0wW;
objs_coors = {};
objs_proxs = {};
objs_quasis = {};
for i = 1 : 3
mymatname = ['../simulated_data/', datatype, '_p', ... |
github | tonyabracadabra/Factorization-Machine-10725-master | optimize_model1.m | .m | Factorization-Machine-10725-master/yanyu_code/optimize_model1.m | 9,068 | utf_8 | b1862ff22098f77ced48129b61f5b113 | %% auther: Yanyu Liang
%% contact: yanyul@andrew.cmu.edu
%% time: 11/05/2016
%% project: Factorization Machines
%% Task: Model 1 - classic FMs
%% Description:
% L = |y - \hat{y}|^2 + lambda1 * |w|_2^2 + lambda2 * |w|_1 + lambda3 * |vec(V)|_2^2
% \hat{y} = w0 + w' * x + x' * V' * V * x
%% Algorithms:
% 1. gradient d... |
github | tonyabracadabra/Factorization-Machine-10725-master | data_generator.m | .m | Factorization-Machine-10725-master/yanyu_code/data_generator.m | 4,796 | utf_8 | b1aeb0d478cd0d2c56e4cf2e2bbff158 | %% auther: Yanyu Liang
%% contact: yanyul@andrew.cmu.edu
%% time: 11/05/2016
%% project: Factorization Machines
%% Task: data generator
%% Description:
% regression problem: input x, output y
% underlying model: y = w0 + w' * x + x' * (V' * V) * x + noise
% simulated data generation:
% step 1: randomly generate ... |
github | tonyabracadabra/Factorization-Machine-10725-master | owlbfgs.m | .m | Factorization-Machine-10725-master/yanyu_code/OPT09/matlab/owlbfgs.m | 5,708 | utf_8 | df169d7bbb8a72603845fd2b90a69732 | % owlbfgs - Orthant-wise L-BFGS algorithm
%
% Syntax:
% [xx, status] = lbfgs(fun, xx, ll, uu, <opt>)
%
% Input:
% fun - objective function
% xx - Initial point for optimization
% ll - lower bound on xx
% uu - upper bound on xx
% Ac - inequality constraint:
% bc - Ac*xx<=bc
% opt... |
github | tonyabracadabra/Factorization-Machine-10725-master | owlbfgs_for_argmin_w0wW.m | .m | Factorization-Machine-10725-master/yanyu_code/OPT09/matlab/owlbfgs_for_argmin_w0wW.m | 6,219 | utf_8 | 56b8767abc9ec83d3f9b21508593a401 | % owlbfgs - Orthant-wise L-BFGS algorithm
%
% Syntax:
% [xx, status] = lbfgs(fun, xx, ll, uu, <opt>)
%
% Input:
% fun - objective function
% xx - Initial point for optimization
% ll - lower bound on xx
% uu - upper bound on xx
% Ac - inequality constraint:
% bc - Ac*xx<=bc
% opt... |
github | tonyabracadabra/Factorization-Machine-10725-master | fistalrl1.m | .m | Factorization-Machine-10725-master/yanyu_code/OPT09/matlab/fistalrl1.m | 2,490 | utf_8 | 82d327224dfdea97f6f8f6ad95aa09b1 | % fistalrl1 - L1-regularized logistic regression by FISTA algorithm
%
% Reference:
% A. Beck and M. Teboulle. A fast iterative shrinkage-thresholding
% algorithm for linear inverse problems.
% SIAM J. Imaging Sciences, 2(1):183202, 2009.
%
% Copyright (C) 2010 Ryota Tomioka
function [xx,stat]=fistalrl1(A,ytr,lambda,... |
github | tonyabracadabra/Factorization-Machine-10725-master | sparsalrl1.m | .m | Factorization-Machine-10725-master/yanyu_code/OPT09/matlab/sparsalrl1.m | 26,538 | utf_8 | 2dbb0d2d9b1204759e2f7df7789bef22 | function [x,x_debias,objective,times,debias_start,mses,taus]= ...
sparsalrl1(y,A,tau,varargin)
% Copyright (C) 2010 Ryota Tomioka
% This software is derived from
% SpaRSA version 2.0, December 31, 2007
% written by Mario Figueiredo, Robert Nowak, and Stephen Wright.
%
% This function solves the convex problem
%... |
github | tonyabracadabra/Factorization-Machine-10725-master | objdall1.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/objdall1.m | 1,655 | utf_8 | fe0b9a2b006aac1db50ddb1e090982e7 | % objdall1 - objective function of DAL with L1 regularization
%
% Copyright(c) 2009-2011 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function varargout=objdall1(aa, info, prob, ww, uu, A, B, lambda, eta)
m = length(aa);
n = length(ww);
if isempty(info.ATaa)
info.ATaa=A.Ttime... |
github | tonyabracadabra/Factorization-Machine-10725-master | set_defaults.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/set_defaults.m | 3,907 | utf_8 | 006370b4b4c3d2399e34f39e019f0a55 | function [opt, isdefault]= set_defaults(opt, varargin)
%[opt, isdefault]= set_defaults(opt, defopt)
%[opt, isdefault]= set_defaults(opt, field/value list)
%
% This functions fills in the given struct opt some new fields with
% default values, but only when these fields DO NOT exist before in opt.
% Existing field... |
github | tonyabracadabra/Factorization-Machine-10725-master | dalsqwl1.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/dalsqwl1.m | 2,639 | utf_8 | 612a6d0e76028162de271725b424c8c9 | % dalsqwl1 - DAL with the weighted squared loss and the L1 regularization
%
% Overview:
% Solves the optimization problem:
% xx = argmin 0.5*sum(weight.*(A*x-bb).^2) + lambda*||x||_1
%
% Syntax:
% [xx,status]=dalsqwl1(xx, A, bb, lambda, weight, <opt>)
%
% Inputs:
% xx : initial solution ([nn,1])
% A : th... |
github | tonyabracadabra/Factorization-Machine-10725-master | dalsqgl.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/dalsqgl.m | 2,939 | utf_8 | e0ef7b87187ba77588a6bb3bf36be73c | % dalsqgl - DAL with squared loss and grouped L1 regularization
%
% Overview:
% Solves the optimization problem:
% xx = argmin 0.5||A*x-bb||^2 + lambda*||x||_G1
% where
% ||x||_G1 = sum(sqrt(sum(xx.^2)))
% (grouped L1 norm)
%
% Syntax:
% [xx,status]=dalsqgl(xx0, A, bb, lambda, <opt>)
%
% Inputs:
% xx0 : ini... |
github | tonyabracadabra/Factorization-Machine-10725-master | spdiag.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/spdiag.m | 295 | utf_8 | c0d22e00533600ff01a1d7666bdb8857 | % spdiag - sparse diagonal matrix
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function D = spdiag(d)
if isempty(d)
D = [];
return;
end
if size(d,1)<size(d,2)
d = d';
end
D = spdiags(d,0,size(d,1),size(d,1)); |
github | tonyabracadabra/Factorization-Machine-10725-master | mvarfilter.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/mvarfilter.m | 484 | utf_8 | 346fef31c23fcfd976223fd915c1ff30 | % mvarfilter - Multivariate AR filter
%
% Example:
% H=randmvar(20,3,10);
% Z=mvarfilter(H0, 2/pi*log(tan(pi*rand(N,M)/2)))';
%
% Copyright(c) 2011 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function Y=mvarfilter(A, X)
[M1,M2,P]=size(A);
[N,M]=size(X);
if M1~=M2 || M1~=M
... |
github | tonyabracadabra/Factorization-Machine-10725-master | objdall1n.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/objdall1n.m | 1,720 | utf_8 | 7aca684d4daf6cff938b12704fc52d13 | % objdall1n - objective function of DAL with non-negative L1 regularization
%
% Copyright(c) 2009-2011 Ryota Tomioka
% 2011 Shigeyuki Oba
% This software is distributed under the MIT license. See license.txt
function varargout=objdall1n(aa, info, prob, ww, uu, A, B, lambda, eta)
m = length(aa);
n = ... |
github | tonyabracadabra/Factorization-Machine-10725-master | dalsql1.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/dalsql1.m | 2,494 | utf_8 | be1ad28de88b72aaca0ee426af3b6b24 | % dalsql1 - DAL with the squared loss and the L1 regularization
%
% Overview:
% Solves the optimization problem:
% xx = argmin 0.5||A*x-bb||^2 + lambda*||x||_1
%
% Syntax:
% [xx,status]=dalsql1(xx, A, bb, lambda, <opt>)
%
% Inputs:
% xx : initial solution ([nn,1])
% A : the design matrix A ([mm,nn]) or a... |
github | tonyabracadabra/Factorization-Machine-10725-master | loss_lrp.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/loss_lrp.m | 419 | utf_8 | debb2d715476d14a5b1787d9f05415d5 | % loss_lrp - logistic loss function
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function [floss, gloss]=loss_lrp(zz, yy)
zy = zz.*yy;
z2 = 0.5*[zy, -zy];
outmax = max(z2,[],2);
sumexp = sum(exp(z2-outmax(:,[1,1])),2);
logpout = z2-(outmax+log(su... |
github | tonyabracadabra/Factorization-Machine-10725-master | ds_softth.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/ds_softth.m | 762 | utf_8 | 2c4da40b882920caf0281d081453d696 | % ds_softth - soft threshold function for DS regularization
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function [vv,ss,info]=ds_softth(vv,lambda,info)
ss=zeros(sum(min(info.blks,[],2)),1);
ixs=0;
ixv=0;
for kk=1:size(info.blks,1)
blk=info.blks(kk,:);
... |
github | tonyabracadabra/Factorization-Machine-10725-master | loss_hsp.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/loss_hsp.m | 445 | utf_8 | bb5ab7baf7e75b9ee81111490527ddf7 | % loss_hsp - hyperbolic secant loss function
%
% Copyright(c) 2009-2011 Ryota Tomioka
% 2009 Stefan Haufe
% This software is distributed under the MIT license. See license.txt
function [floss, gloss]=loss_hsp(zz, bb)
% floss = -sum(log(sech(bb-zz)./pi));
% gloss = tanh(zz-bb);
zz = zz-bb;
mz = abs(z... |
github | tonyabracadabra/Factorization-Machine-10725-master | l1n_softth.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/l1n_softth.m | 354 | utf_8 | 815a804eca57e0d586b959f724bdc41c | % l1n_softth - soft threshold function for non-negative L1 regularization
%
% Copyright(c) 2009-2011 Ryota Tomioka
% 2011 Shigeyuki Oba
% This software is distributed under the MIT license. See license.txt
function [vv,ss]=l1n_softth(vv,lambda,info)
n = size(vv,1);
I=find(vv>lambda);
vv=sparse(I,1... |
github | tonyabracadabra/Factorization-Machine-10725-master | en_dnorm.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/en_dnorm.m | 341 | utf_8 | b360a589f93eedfdd3e0c5f739049d8c | % en_dnorm - conjugate of the Elastic-net regularizer
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function [nm,ishard]=en_dnorm(ww,lambda,theta)
if theta<1
ishard=0;
nm = 0.5*sum(max(0,abs(ww)-lambda*theta).^2)/(lambda*(1-theta));
else
ishard=1;
nm ... |
github | tonyabracadabra/Factorization-Machine-10725-master | hessMultdalds.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/hessMultdalds.m | 1,632 | utf_8 | 3b780b4611bf0790d4b1393d2b48cd92 | % hessMultdalds - function that computes H*x for DAL with the
% dual spectral norm (trace norm) regularization
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function bb = hessMultdalds(aa, A, eta, Hinfo)
info=Hinfo.info;
hloss=Hinfo.hloss;
la... |
github | tonyabracadabra/Factorization-Machine-10725-master | dal.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/dal.m | 10,998 | utf_8 | 6f0962865f9789ee20df1114ee416f6d | % dal - dual augmented Lagrangian method for sparse learaning/reconstruction
%
% Overview:
% Solves the following optimization problem
% xx = argmin f(x) + lambda*c(x)
% where f is a user specified (convex, smooth) loss function and c
% is a measure of sparsity (currently L1 or grouped L1)
%
% Syntax:
% [ww, uu, ... |
github | tonyabracadabra/Factorization-Machine-10725-master | dallrl1.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/dallrl1.m | 2,588 | utf_8 | 0f366a82181d792c9692defad1b2d148 | % dallrl1 - DAL with logistic loss and the L1 regularization
%
% Overview:
% Solves the optimization problem:
% [xx, bias] = argmin sum(log(1+exp(-yy.*(A*x+bias)))) + lambda*||x||_1
%
% Syntax:
% [ww,bias,status]=dallrl1(ww0, bias0, A, yy, lambda, <opt>)
%
% Inputs:
% ww0 : initial solution ([nn,1])
% bias0 :... |
github | tonyabracadabra/Factorization-Machine-10725-master | l1_softth.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/l1_softth.m | 338 | utf_8 | b5cfb9ee5042e9a3ec5ee4f76bdc9934 | % l1_softth - soft threshold function for L1 regularization
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function [vv,ss]=l1_softth(vv,lambda,info)
n = size(vv,1);
Ip=find(vv>lambda);
In=find(vv<-lambda);
vv=sparse([Ip;In],1,[vv(Ip)-lambda;vv(In)+lambda],... |
github | tonyabracadabra/Factorization-Machine-10725-master | objdalgl.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/objdalgl.m | 2,680 | utf_8 | 2e2a3317d137d233ef8b8c14763f8010 | % objdalgl - objective function of DAL with grouped L1 regularization
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function varargout=objdalgl(aa, info, prob, ww, uu, A, B, lambda, eta)
nn=sum(info.blks);
if isempty(info.ATaa)
info.ATaa=A.Ttimes(aa);
end... |
github | tonyabracadabra/Factorization-Machine-10725-master | hessMultdalgl.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/hessMultdalgl.m | 681 | utf_8 | bc168bca3a884574a4b2262ba694e29b | % hessMultdalgl - function that computes H*x for DAL with grouped
% L1 regularization
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function yy = hessMultdalgl(xx, A, eta, Hinfo)
blks =Hinfo.blks;
hloss=Hinfo.hloss;
I =Hinfo.I;
vv =Hinfo... |
github | tonyabracadabra/Factorization-Machine-10725-master | dallren.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/dallren.m | 2,311 | utf_8 | 8d6c5226ec8d59ee199600c7ad5e8716 | % dallren - DAL with logistic loss and the Elastic-net regularization
%
% Overview:
% Solves the optimization problem:
% [xx, bias] = argmin sum(log(1+exp(-yy.*(A*x+bias)))) + lambda*sum(theta*abs(x)+0.5*(1-theta)*x.^2)
%
% Syntax:
% [xx,bias,status]=dallren(xx, bias,A, yy, lambda, <opt>)
%
% Inputs:
% xx : in... |
github | tonyabracadabra/Factorization-Machine-10725-master | gl_dnorm.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/gl_dnorm.m | 310 | utf_8 | 548ff135b603e34521e688eaf10f3709 | % gl_dnorm - conjugate of the grouped L1 regularizer
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function [nm,ishard]=gl_dnorm(ww,blks)
nm=0;
ix0=0;
for kk=1:length(blks)
I=ix0+(1:blks(kk));
ix0=I(end);
nm=max(nm, norm(ww(I)));
end
ishard=1; |
github | tonyabracadabra/Factorization-Machine-10725-master | vec.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/vec.m | 197 | utf_8 | b1da0371244534faa076d4892c1f5bec | % vec - vectorize an array
%
% Copyright(c) 2009-2011 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function V=vec(M)
sz=size(M);
V=reshape(M, [prod(sz), 1]);
|
github | tonyabracadabra/Factorization-Machine-10725-master | dalsqds.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/dalsqds.m | 2,797 | utf_8 | 64787b7d4248e88a6636639e7ecbe931 | % dalsqds - DAL with squared loss and the dual spectral norm
% (trace norm) regularization
%
% Overview:
% Solves the optimization problem:
% ww = argmin 0.5||A*x-bb||^2 + lambda*||w||_DS
%
% where ||w||_DS = sum(svd(w))
%
% Syntax:
% [ww,bias,status]=dalsqds(ww, bias, A, yy, lambda, <opt>)
%
% Inputs:... |
github | tonyabracadabra/Factorization-Machine-10725-master | archive.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/archive.m | 284 | utf_8 | f6095975ffda71bd8c3d6d9aae23a25e | % archive - pack variables into a struct
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function S=archive(varargin)
S = [];
for i=1:length(varargin)
name =varargin{i};
S = setfield(S, name, evalin('caller', name));
end
|
github | tonyabracadabra/Factorization-Machine-10725-master | loss_hsd.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/loss_hsd.m | 697 | utf_8 | 318eb18ee26cd792789ce9e7874a4f59 | % loss_hsd - conjugate hyperbolic secant loss function
%
% Syntax:
% [floss, gloss, hloss, hmin]=loss_hsd(aa, yy)
%
% Copyright(c) 2009-2011 Ryota Tomioka
% 2009 Stefan Haufe
% This software is distributed under the MIT license. See license.txt
function varargout=loss_hsd(zz, bb)
m=length(bb);
glos... |
github | tonyabracadabra/Factorization-Machine-10725-master | en_spec.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/en_spec.m | 240 | utf_8 | 5c3c02603f633b327c2329792acd9f75 | % en_spec - spectrum function for the Elastic-net regularizer
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function nm=en_spec(ww,theta)
nm=theta*abs(ww)+0.5*(1-theta)*ww.^2;
|
github | tonyabracadabra/Factorization-Machine-10725-master | l1n_spec.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/l1n_spec.m | 377 | utf_8 | f6ec361bb27d59f27d21647d93e32ec7 | % l1n_spec - spectrum function for the non-negative L1 regularizer
%
% Copyright(c) 2009-2011 Ryota Tomioka
% 2011 Shigeyuki Oba
% This software is distributed under the MIT license. See license.txt
function ss=l1n_spec(ww)
n=size(ww,1);
Ip=find(ww>0); lenp=length(Ip);
In=find(ww<0); lenn=length(I... |
github | tonyabracadabra/Factorization-Machine-10725-master | dallral1.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/dallral1.m | 2,894 | utf_8 | 48831d493dfcb4e186cd220479af2bc8 | % dallral1 - DAL with logistic loss and the adaptive L1 regularization
%
% Overview:
% Solves the optimization problem:
% [xx, bias] = argmin sum(log(1+exp(-yy.*(A*x+bias)))) + ||pp.*x||_1
%
% Syntax:
% [ww,bias,status]=dallral1(ww0, bias0, A, yy, pp, <opt>)
%
% Inputs:
% ww0 : initial solution ([nn,1])
% bias... |
github | tonyabracadabra/Factorization-Machine-10725-master | loss_sqpw.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/loss_sqpw.m | 263 | utf_8 | d5891fc0e2bd5020818a554d66963234 | % loss_sqpw - weighted squared loss function
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function [floss, gloss]=loss_sqpw(zz, bb, weight)
gloss = weight.*(zz-bb);
floss = 0.5*sum(weight.*(zz-bb).^2); |
github | tonyabracadabra/Factorization-Machine-10725-master | loss_lrd.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/loss_lrd.m | 574 | utf_8 | f1fa72d1eff87af2af3f4fccf018fd9c | % loss_lrd - conjugate logistic loss function
%
% Syntax:
% [floss, gloss, hloss, hmin]=loss_lrd(aa, yy)
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function varargout = loss_lrd(aa, yy)
mm=length(aa);
gloss=nan*ones(mm,1);
ya = aa.*yy;
I = find(0<ya & ... |
github | tonyabracadabra/Factorization-Machine-10725-master | dallrgl.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/dallrgl.m | 3,479 | utf_8 | 56bf09c20dc735bc3d3dd7c6a74de4a7 | % dallrgl - DAL with logistic loss and grouped L1 regularization
%
% Overview:
% Solves the optimization problem:
% [xx,bias] = argmin sum(log(1+exp(-yy.*(A*x+bias)))) + lambda*||x||_G1
% where
% ||x||_G1 = sum(sqrt(sum(xx(Ii).^2)))
% (Ii is the index-set of the i-th group
%
% Syntax:
% [xx,bias,status]=dallrg... |
github | tonyabracadabra/Factorization-Machine-10725-master | objdalds.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/objdalds.m | 1,484 | utf_8 | 670fbfb2f3845d2ffc874b8d01c0cddc | % objdalds - objective function of DAL with the dual spectral norm
% (trace norm) regularization
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function varargout=objdalds(aa, info, prob, ww, uu, A, B, lambda, eta)
m = length(aa);
if isempty(info.... |
github | tonyabracadabra/Factorization-Machine-10725-master | objdalen.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/objdalen.m | 1,712 | utf_8 | 84fae65797c7a2d6a00e4274a48e214d | % objdalen - objective function of DAL with the Elastic-net regularization
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function varargout=objdalen(aa, info, prob, ww, uu, A, B, lambda, eta)
theta=info.theta;
m = length(aa);
n = length(ww);
if isempty(inf... |
github | tonyabracadabra/Factorization-Machine-10725-master | ds_dnorm.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/ds_dnorm.m | 353 | utf_8 | 2989cfee52d30f7227684a727837bcb5 | % ds_dnorm - conjugate of the dual spectral norm regularizer
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function [nm,ishard]=ds_dnorm(ww,blks)
nm=0;
ix0=0;
for kk=1:size(blks,1)
blk=blks(kk,:);
I=ix0+(1:blk(1)*blk(2));
ix0=I(end);
nm=max(nm,norm(re... |
github | tonyabracadabra/Factorization-Machine-10725-master | evalgap.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/evalgap.m | 594 | utf_8 | 2335b40b2884ed2677231e2068a39e40 | function gap = evalgap(fnc, fspec, dnorm, ww, uu, A, B, lambda)
[ff,gg]=evalloss(fnc,ww,uu,A,B);
fval = ff+lambda*sum(fspec(ww));
dval = evaldual(fnc,dnorm,-gg,A,B,lambda);
gap = (fval+dval)/fval;
function [fval,gg]=evalloss(fnc, ww, uu, A, B)
if ~isempty(uu)
zz=A*ww+B*uu;
else
zz=A*ww;
end
[fval, gg] =fnc.p(... |
github | tonyabracadabra/Factorization-Machine-10725-master | hessMultdall1.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/hessMultdall1.m | 421 | utf_8 | 0b74b26b2f1ac5be768d661e759c297b | % hessMultdall1 - function that computes H*x for DAL with L1
% regularization
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function yy = hessMultdall1(xx, A, eta, Hinfo)
hloss=Hinfo.hloss;
AF=Hinfo.AF;
I=Hinfo.I;
n=Hinfo.n;
len=length(I);
yy... |
github | tonyabracadabra/Factorization-Machine-10725-master | dalsqal1.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/dalsqal1.m | 2,792 | utf_8 | ce730257841ca14e2909291612d34fc6 | % dalsqal1 - DAL with the squared loss and the adaptive L1 regularization
%
% Overview:
% Solves the optimization problem:
% xx = argmin 0.5||A*x-bb||^2 + ||pp.*x||_1
%
% Syntax:
% [xx,status]=dalsqal1(xx, A, bb, pp, <opt>)
%
% Inputs:
% xx : initial solution ([nn,1])
% A : the design matrix A ([mm,nn]) ... |
github | tonyabracadabra/Factorization-Machine-10725-master | gl_spec.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/gl_spec.m | 324 | utf_8 | 85b9979a663d9937f3cfa0f3ef96c135 | % gl_spec - spectrum function for the grouped L1 regularizer
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function nm=gl_spec(ww,blks)
nn=length(blks);
nm=zeros(nn,1);
ixw=0;
for kk=1:length(blks)
I=ixw+(1:blks(kk));
ixw=I(end);
nm(kk)=norm(ww(I));
... |
github | tonyabracadabra/Factorization-Machine-10725-master | loss_sqp.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/loss_sqp.m | 224 | utf_8 | 22264a52cbc12f19b18430efdb90d6a9 | % loss_sqp - squared loss function
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function [floss, gloss]=loss_sqp(zz, bb)
gloss = zz-bb;
floss = 0.5*sum(gloss.^2); |
github | tonyabracadabra/Factorization-Machine-10725-master | dalhsgl.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/dalhsgl.m | 3,257 | utf_8 | 72669c634654e258157b77e20175be1d | % dalhsgl - DAL with hyperbolic secant loss and grouped L1 regularization
%
% Overview:
% Solves the optimization problem:
% [xx,bias] = argmin sum(log(sech(A*x+bias))) + lambda*||x||_G1
% where
% ||x||_G1 = sum(sqrt(sum(xx(Ii).^2)))
% (Ii is the index-set of the i-th group
%
% Syntax:
% [xx,bias,status]=dallr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.