debian/0000755000000000000000000000000011414437711007171 5ustar debian/libocas0.symbols0000644000000000000000000000022311410750336012271 0ustar libocas.so.0 libocas0 #MINVER# libqp_splx_solver@Base 0.93 msvm_ocas_solver@Base 0.93 svm_ocas_solver@Base 0.93 svm_ocas_solver_difC@Base 0.93 debian/libocas-dev.dirs0000644000000000000000000000002411410750336012235 0ustar usr/lib usr/include debian/libocas-dev.install0000644000000000000000000000011711410750336012745 0ustar libocas.h usr/include libqp.h usr/include libocas.so usr/lib libocas.a usr/lib debian/libocas-tools.manpages0000644000000000000000000000006511410750336013456 0ustar debian/svmocas.1 debian/msvmocas.1 debian/linclass.1 debian/svmocas.10000644000000000000000000000633711410750336010734 0ustar .\" Hey, EMACS: -*- nroff -*- .TH SVMOCAS 1 "June 16, 2010" .SH NAME svmocas \- train a binary linear SVM classifier .SH SYNOPSIS .B svmocas .RI [ options ] " example_file " \fImodel_file\fP .SH DESCRIPTION \fBsvmocas\fP is a program that trains a binary linear SVM classifier using the Optimized Cutting Plane Algorithm for Support Vector Machines (OCAS) and produces a model file. .PP \fIexample_file\fP is a file with training examples in SVM^light format, and \fImodel_file\fP is the file in which to store the learned linear rule \fBf(x)=w'*x+w0\fP. \fImodel_file\fP contains \fBd\fP lines, where \fBd\fP is the number of data dimensions. The first n lines are coordinates of \fBw\fP and the last line is \fBw0\fP. .SH OPTIONS A summary of options is included below. .PP \fBGeneral options:\fP .TP .B \-h Show summary of options. .TP .B \-v \fI(0|1)\fP Set the verbosity level (default: \fB1\fP) .PP \fBLearning options:\fP .TP .B \-c \fIfloat\fB Regularization constant C. (default: \fB1\fP) .TP .B \-C \fIconstants_file\fB If specified, each example has a different regularization constant, taken from the text file \fIconstants_file\fP. Each line of the text file must contain a single constant (positive double) for the corresponding example. If \fB-C\fP is used, then the \fB-c\fP option is ignored. .TP .B \-b \fI(0|1)\fP Value of the L2-bias feature. A value of 0 implies not having bias. (default: \fB0\fP) .TP .B \-n \fIinteger\fP Use only the first \fIinteger\fP examples for training. By default, \fIinteger\fP equals the number of examples in \fIexample_file\fP. .PP \fBOptimization options:\fP .TP .B \-m \fI(0|1)\fP Solver to be used: .sp .RS 12 .nf 0 ... standard cutting plane (equivalent to BMRM, SVM^perf) .sp 1 ... OCAS (default) .fi .RE .TP .B \-s \fIinteger\fP Cache size for cutting planes. (default: \fB2000\fP) .TP .B \-p \fIinteger\fP Number of threads. (default: \fB1\fP) .PP \fBStopping conditions:\fP .TP .B \-a \fIfloat\fP Absolute tolerance TolAbs: halt if \fBQP-QD <= TolAbs\fP. (default: \fB0\fP) .TP .B \-r \fIfloat\fP Relative tolerance TolAbs: halt if \fBQP-QD <= abs(QP)*TolRel\fP. (default: \fB0.01\fP) .TP .B \-q \fIfloat\fP Desired objective value QPValue: halt is \fBQP <= QPValue\fP. (default: \fB0\fP) .TP .B \-t \fIfloat\fP Halts if the solver time (loading time is not counted) exceeds the time given in seconds. (default: \fBinfinity\fP) .SH EXAMPLES Train the binary SVM classifier from \fIriply_trn.light\fP, with the regularization constant C=10, bias switched on, verbosity switched off, and save model to \fIsvmocas.model\fP: .sp .RS 12 .nf svmocas \-c 10 \-b 1 \-v 0 riply_trn.light svmocas.model .fi .RE .sp Compute the testing error of the classifier stored in \fIsvmocas.model\fP with \fBlinclass\fP(1) using testing examples from \fIriply_tst.light\fP and save the predicted labels to \fIriply_tst.pred\fP: .sp .RS 12 .nf linclass \-e \-o riply_tst.pred riply_tst.light svmocas.model .fi .RE .SH SEE ALSO .BR msvmocas (1), .BR linclass (1). .SH AUTHORS svmocas was written by Vojtech Franc and Soeren Sonnenburg . .PP This manual page was written by Christian Kastner , for the Debian project (and may be used by others). debian/patches/0000755000000000000000000000000011410750336010615 5ustar debian/patches/series0000644000000000000000000000007711410750336012036 0ustar 0001-Properly-build-shared-and-static-libraries-programs.patch debian/patches/0001-Properly-build-shared-and-static-libraries-programs.patch0000644000000000000000000000731311410750336024224 0ustar From: Christian Kastner Date: Thu, 17 Jun 2010 15:39:15 +0200 Subject: [PATCH] Properly build shared and static libraries, programs Modify upstream's Makefile to properly build shared and static libraries, and link upstream's programs to the shared libraries. Forwarded: no Last-Update: 2010-06-17 --- Makefile | 48 +++++++++++++++++++++++++++++++++++------------- 1 files changed, 35 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 2ed4145..7ddb88e 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,23 @@ MEX := mex MEXFLAGS := $(shell if uname -m | grep -q x86_64 ; then echo -largeArrayDims ; fi) MEXSUFFIX := $(shell if uname -m | grep -q x86_64 ; then echo mexa64 ; else echo mexglx ; fi) CC := gcc -#CFLAGS := -g -lm -Wall -pthread -CFLAGS := -lm -msse -O3 -fPIC -fstrict-aliasing -fomit-frame-pointer -Wall -pthread -#CFLAGS := -lm -msse -O3 -fPIC -fstrict-aliasing -fomit-frame-pointer -Wall -#CFLAGS := -lm -msse -O3 -fPIC -fopenmp -fstrict-aliasing -fomit-frame-pointer -Wall + +CFLAGS += +LDFLAGS += +LIBS += -lm + +LIB_CFLAGS = $(CFLAGS) -fPIC +LIB_LDFLAGS = $(LDFLAGS) +LIB_LIBS = $(LIBS) + +PROG_CFLAGS = $(CFLAGS) +PROG_LDFLAGS = $(LDFLAGS) -L. +PROG_LIBS = $(LIBS) -lpthread -locas + +# The real LVER/LSUBVER should be passed on by debian/rules +LVER ?= 0 +LSUBVER ?= 0 +LIBFILE = libocas.so.$(LVER).$(LSUBVER) ifeq (yes,$(MEXDETECTED)) @@ -43,21 +56,30 @@ lbpfilter.$(MEXSUFFIX): lbpfilter_mex.c else -all: libocas.so svmocas msvmocas +all: $(LIBFILE) svmocas msvmocas linclass libocas.a endif -svmocas: svmocas.c lib_svmlight_format.c sparse_mat.c ocas_helper.c ocas_helper.h libocas.h sparse_mat.h libocas.c - $(CC) $(CFLAGS) -o $@ svmocas.c lib_svmlight_format.c sparse_mat.c ocas_helper.c libocas.c libqp_splx.c +svmocas: svmocas.c lib_svmlight_format.c sparse_mat.c ocas_helper.c ocas_helper.h libocas.h sparse_mat.h $(LIBFILE) + $(CC) $(PROG_CFLAGS) $(PROG_LDFLAGS) -o $@ svmocas.c lib_svmlight_format.c sparse_mat.c ocas_helper.c $(PROG_LIBS) -msvmocas: msvmocas.c lib_svmlight_format.c sparse_mat.c ocas_helper.c ocas_helper.h libocas.h sparse_mat.h libocas.c - $(CC) $(CFLAGS) -o $@ msvmocas.c lib_svmlight_format.c sparse_mat.c ocas_helper.c libocas.c libqp_splx.c +msvmocas: msvmocas.c lib_svmlight_format.c sparse_mat.c ocas_helper.c ocas_helper.h libocas.h sparse_mat.h $(LIBFILE) + $(CC) $(PROG_CFLAGS) $(PROG_LDFLAGS) -o $@ msvmocas.c lib_svmlight_format.c sparse_mat.c ocas_helper.c $(PROG_LIBS) linclass: linclass.c lib_svmlight_format.c libocas.h - $(CC) $(CFLAGS) -o $@ linclass.c lib_svmlight_format.c + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ linclass.c lib_svmlight_format.c $(LIBS) + +$(LIBFILE): libocas.c libocas.h libqp_splx.c libqp.h + $(CC) $(LIB_CFLAGS) $(LIB_LDFLAGS) -shared \ + -Wl,-soname,libocas.so.$(LVER) \ + -o $@ libocas.c libqp_splx.c $(LIB_LIBS) + ln -s $@ libocas.so.$(LVER) + ln -s libocas.so.$(LVER) libocas.so -libocas.so: libocas.c libocas.h libqp_splx.c libqp.h - $(CC) $(CFLAGS) -shared -o $@ libocas.c libqp_splx.c +libocas.a: + $(CXX) $(CFLAGS) $(LDFLAGS) -c -o libocas-static.o libocas.c + $(CXX) $(CFLAGS) $(LDFLAGS) -c -o libqp_splx-static.o libqp_splx.c + ar cru libocas.a libocas-static.o libqp_splx-static.o clean: - rm -f *~ svmocas.$(MEXSUFFIX) svmlight_linclass.$(MEXSUFFIX) svmocas msvmocas linclass libocas.so msvmocas.$(MEXSUFFIX) lbpfilter.$(MEXSUFFIX) lbppyr_features.$(MEXSUFFIX) svmocas_lbp.$(MEXSUFFIX) lbppyr.$(MEXSUFFIX) compute_errors.$(MEXSUFFIX) + rm -f *~ *.o libocas.a svmocas.$(MEXSUFFIX) svmlight_linclass.$(MEXSUFFIX) svmocas msvmocas linclass libocas.so* msvmocas.$(MEXSUFFIX) lbpfilter.$(MEXSUFFIX) lbppyr_features.$(MEXSUFFIX) svmocas_lbp.$(MEXSUFFIX) lbppyr.$(MEXSUFFIX) compute_errors.$(MEXSUFFIX) -- debian/libocas0.dirs0000644000000000000000000000001011410750336011534 0ustar usr/lib debian/copyright0000644000000000000000000000315711410750336011127 0ustar Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 Name: LIBOCAS Source: http://cmp.felk.cvut.cz/~xfrancv/ocas/ Copyright: 2008-2010, Vojtech Franc 2008-2010, Soeren Sonnenburg License: GPL-3+ 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. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . On Debian systems, the full text of the GNU General Public License version 3 can be found in the file `/usr/share/common-licenses/GPL-3'. Files: debian/* Copyright: 2010, Christian Kastner License: GPL-3+ 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. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . On Debian systems, the full text of the GNU General Public License version 3 can be found in the file `/usr/share/common-licenses/GPL-3'. debian/README.Debian0000644000000000000000000000056511410750336011235 0ustar libocas for Debian -------------------- For more information (including formulations) about LIBOCAS, you are strongly advised to read upstream's README file in /usr/share/doc/libocas0/README. To compile software against libocas, you need to include "libocas.h" and link against libocas with -locas. -- Christian Kastner Sat, 12 Jun 2010 21:21:11 +0200 debian/changelog0000644000000000000000000000035111410750336011037 0ustar libocas (0.93-1) unstable; urgency=low * Initial release (Closes: #585788) * debian/patches: - 0001-Properly-build-shared-and-static-libraries-programs -- Christian Kastner Thu, 17 Jun 2010 16:38:22 +0200 debian/libocas0.install0000644000000000000000000000002211410750336012244 0ustar lib*.so.* usr/lib debian/source/0000755000000000000000000000000011410750336010466 5ustar debian/source/format0000644000000000000000000000001411410750336011674 0ustar 3.0 (quilt) debian/linclass.10000644000000000000000000000365111410750336011065 0ustar .\" Hey, EMACS: -*- nroff -*- .TH LINCLASS 1 "June 16, 2010" .SH NAME linclass \- predict labels by a linear classification rule .SH SYNOPSIS .B linclass .RI [ options ] " example_file " \fImodel_file\fP .SH DESCRIPTION \fBlinclass\fP is a program that predicts labels by a linear classification rule. .PP \fIexample_file\fP is a file with testing examples in SVM^light format, and \fImodel_file\fP is the file which contains either a binary (two-class) rule \fBf(x)=w'*x+w0\fP or a multi-class rule \fBf(x)=W'*x\fP. These are produced \fBsvmocas\fP(1) and \fBmsvmocas\fP(1), respectively. .SH OPTIONS A summary of options is included below. .TP .B \-h Show summary of options. .TP .B \-v \fI(0|1)\fP Set the verbosity level (default: \fB1\fP) .TP .B \-e Print the classification error computed from predicted labels and labels contained in \fIexample_file\fP. .TP .B \-o \fIout_file\fP Save predictions to the file \fIout_file\fP. .TP .B \-t \fI(0|1)\fP Output type: .sp .RS 12 .nf 0 ... predicted labels (default) .sp 1 ... discriminant values .fi .RE .SH EXAMPLES Train the multi-class SVM classifier from example file \fIfiply_trn.light\fP, using \fBsvmocas\fP(1) with the regularization constant C=10, verbosity switched off, and save model to \fIsvmocas.model\fP: .sp .RS 12 .nf svmocas \-c 10 \-b 1 \-v 0 riply_trn.light svmocas.model .fi .RE .sp Compute the testing error of the classifier stored in \fIsvmocas.model\fP using testing examples from \fIriply_tst.light\fP and save the predicted labels to \fIriply_tst.pred\fP: .sp .RS 12 .nf linclass \-e \-o riply_tst.pred riply_tst.light svmocas.model .fi .RE .SH SEE ALSO .BR svmocas (1), .BR msvmocas (1). .SH AUTHORS linclass was written by Vojtech Franc and Soeren Sonnenburg . .PP This manual page was written by Christian Kastner , for the Debian project (and may be used by others). debian/libocas-tools.install0000644000000000000000000000004111410750336013323 0ustar svmocas usr/bin msvmocas usr/bin debian/msvmocas.10000644000000000000000000000550011410750336011100 0ustar .\" Hey, EMACS: -*- nroff -*- .TH MSVMOCAS 1 "June 16, 2010" .SH NAME msvmocas \- train a multi-class linear SVM classifier .SH SYNOPSIS .B msvmocas .RI [ options ] " example_file " \fImodel_file\fP .SH DESCRIPTION \fBmsvmocas\fP is a program that trains a multi-class linear SVM classifier using the Optimized Cutting Plane Algorithm for Support Vector Machines (OCAS) and produces a model file. .PP \fIexample_file\fP is a file with training examples in SVM^light format, and \fImodel_file\fP is the file in which to store the learned linear rule \fBf(x)=W'*x\fP. \fImodel_file\fP contains \fBM\fP columns and \fBD\fP lines, where \fBM\fP is the number of classes and \fBD\fP the number of dimensions, corresponding to the elements of the matrix \fBW [D x M]\fP. .SH OPTIONS A summary of options is included below. .PP \fBGeneral options:\fP .TP .B \-h Show summary of options. .TP .B \-v \fI(0|1)\fP Set the verbosity level (default: \fB1\fP) .PP \fBLearning options:\fP .TP .B \-c \fIfloat\fB Regularization constant C. (default: \fB1\fP) .TP .B \-n \fIinteger\fP Use only the first \fIinteger\fP examples for training. By default, \fIinteger\fP equals the number of examples in \fIexample_file\fP. .PP \fBOptimization options:\fP .TP .B \-m \fI(0|1)\fP Solver to be used: .sp .RS 12 .nf 0 ... standard cutting plane (equivalent to BMRM, SVM^perf) .sp 1 ... OCAS (default) .fi .RE .TP .B \-s \fIinteger\fP Cache size for cutting planes. (default: \fB2000\fP) .PP \fBStopping conditions:\fP .TP .B \-a \fIfloat\fP Absolute tolerance TolAbs: halt if \fBQP-QD <= TolAbs\fP. (default: \fB0\fP) .TP .B \-r \fIfloat\fP Relative tolerance TolAbs: halt if \fBQP-QD <= abs(QP)*TolRel\fP. (default: \fB0.01\fP) .TP .B \-q \fIfloat\fP Desired objective value QPValue: halt is \fBQP <= QPValue\fP. (default: \fB0\fP) .TP .B \-t \fIfloat\fP Halts if the solver time (loading time is not counted) exceeds the time given in seconds. (default: \fBinfinity\fP) .SH EXAMPLES Train the multi-class SVM classifier from example file \fIexample4_train.light\fP, with the regularization constant C=10, verbosity switched off, and save model to \fImsvmocas.model\fP: .sp .RS 12 .nf msvmocas \-c 10 \-v 0 example4_train.light msvmocas.model .fi .RE .sp Compute the testing error of the classifier stored in \fImsvmocas.model\fP with \fBlinclass\fP(1) using testing examples from \fIexample4_test.light\fP and save the predicted labels to \fIexample4_test.pred\fP: .sp .RS 12 .nf linclass \-e \-o example4_test.pred example4_test.light msvmocas.model .fi .RE .SH SEE ALSO .BR svmocas (1), .BR linclass (1). .SH AUTHORS msvmocas was written by Vojtech Franc and Soeren Sonnenburg . .PP This manual page was written by Christian Kastner , for the Debian project (and may be used by others). debian/control0000644000000000000000000000532211410750336010573 0ustar Source: libocas Section: libs Priority: optional Maintainer: Christian Kastner Build-Depends: debhelper (>= 7.0.50~) Standards-Version: 3.8.4 Homepage: http://cmp.felk.cvut.cz/~xfrancv/ocas/html/ Vcs-Git: git://scm.kvr.at/git/pkg-libocas.git Vcs-Browser: http://scm.kvr.at/git/pkg-libocas.git;a=summary Package: libocas-dev Section: libdevel Architecture: any Depends: ${misc:Depends}, libocas0 (= ${binary:Version}) Description: Development libraries and header files for LIBOCAS This library implements Optimized Cutting Plane Algorithm (OCAS) for training linear Support Vector Machine (SVM) classifiers from large-scale data. The computational effort of OCAS scales linearly with the number of training examples. It is one of the fastest SVM solvers around for solving linear and multiclass L2 regularized SVMs. . This package contains the header files and static libraries. Package: libocas0 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Recommends: libocas-tools (= ${binary:Version}) Suggests: libocas-dev (= ${binary:Version}) Description: OCAS solver for training linear SVM classifiers This library implements Optimized Cutting Plane Algorithm (OCAS) for training linear Support Vector Machine (SVM) classifiers from large-scale data. The computational effort of OCAS scales linearly with the number of training examples. It is one of the fastest SVM solvers around for solving linear and multiclass L2 regularized SVMs. . This package contains the shared libraries. Package: libocas-dbg Priority: extra Section: debug Architecture: any Depends: ${misc:Depends}, libocas0 (= ${binary:Version}), libocas-tools (= ${binary:Version}) Description: Debugging symbols for LIBOCAS This library implements Optimized Cutting Plane Algorithm (OCAS) for training linear Support Vector Machine (SVM) classifiers from large-scale data. The computational effort of OCAS scales linearly with the number of training examples. It is one of the fastest SVM solvers around for solving linear and multiclass L2 regularized SVMs. . This package contains the debugging symbols. Package: libocas-tools Section: science Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libocas0 (= ${binary:Version}) Description: Standalone applications implementing the OCAS solver This library implements Optimized Cutting Plane Algorithm (OCAS) for training linear Support Vector Machine (SVM) classifiers from large-scale data. The computational effort of OCAS scales linearly with the number of training examples. It is one of the fastest SVM solvers around for solving linear and multiclass L2 regularized SVMs. . This package contains the standalone applications. debian/libocas0.docs0000644000000000000000000000001711410750336011532 0ustar AUTHORS README debian/rules0000755000000000000000000000115111410750336010244 0ustar #!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # Get version numbers for SONAME from changelog DVER = $(shell dpkg-parsechangelog | grep '^Version') LVER = $(shell echo $(DVER) | sed -e 's/Version: \([0-9]*\)\..*/\1/') LSUBVER = $(shell echo $(DVER) | sed -e 's/Version: .*\.\([0-9]*\).*/\1/') export LVER export LSUBVER CFLAGS = -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O3 ifeq (amd64,$(DEB_HOST_ARCH)) CFLAGS += -msse endif endif %: dh $@ override_dh_strip: dh_strip --dbg-package=libocas-dbg debian/watch0000644000000000000000000000014011410750336010212 0ustar version=3 opts=dversionmangle=s/\.// \ http://cmp.felk.cvut.cz/~xfrancv/ocas/libocas_v(.*).zip debian/compat0000644000000000000000000000000211410750336010364 0ustar 7