Upstream update

epel8
Ding-Yi Chen 15 years ago
parent 35fc752c1a
commit 4fad22ccdc

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 B

@ -1 +1,2 @@
libsvm-2_89-4_fc11:EL-5:libsvm-2.89-4.fc11.src.rpm:1253237689
libsvm-2_90-1_fc11:EL-5:libsvm-2.90-1.fc11.src.rpm:1257318817

@ -1,6 +1,6 @@
diff -up ./java/Makefile.orig ./java/Makefile
--- ./java/Makefile.orig 2009-02-18 10:41:04.000000000 +1000
+++ ./java/Makefile 2009-09-18 10:13:04.000000000 +1000
+++ ./java/Makefile 2009-11-04 14:13:41.000000000 +1000
@@ -4,13 +4,21 @@ FILES = libsvm/svm.class libsvm/svm_mode
libsvm/svm_print_interface.class \
svm_train.class svm_predict.class svm_toy.class svm_scale.class
@ -51,18 +51,19 @@ diff -up ./java/Makefile.orig ./java/Makefile
rm *.class libsvm/*.class
diff -up ./java/test_applet.html.orig ./java/test_applet.html
--- ./java/test_applet.html.orig 2003-07-12 14:07:32.000000000 +1000
+++ ./java/test_applet.html 2009-09-18 10:10:34.000000000 +1000
+++ ./java/test_applet.html 2009-11-04 14:13:41.000000000 +1000
@@ -1 +1,3 @@
-<APPLET code="svm_toy.class" archive="libsvm.jar" width=300 height=350></APPLET>
+<html>
+<applet code="svm_toy.class" archive="libsvm.jar" width=300 height=350></applet>
+</html>
diff -up ./Makefile.orig ./Makefile
--- ./Makefile.orig 2008-09-15 14:36:48.000000000 +1000
+++ ./Makefile 2009-09-18 10:10:34.000000000 +1000
--- ./Makefile.orig 2009-07-01 07:13:50.000000000 +1000
+++ ./Makefile 2009-11-04 14:13:41.000000000 +1000
@@ -1,11 +1,40 @@
CXX? = g++
-CXX ?= g++
-CFLAGS = -Wall -Wconversion -O3 -fPIC
+CXX ? = g++
+CFLAGS = ${RPM_CFLAGS} -Wall -Wconversion -O3 -fPIC
SHVER = 1
+MAKE = make
@ -172,9 +173,11 @@ diff -up ./Makefile.orig ./Makefile
+
+
diff -up ./python/Makefile.orig ./python/Makefile
--- ./python/Makefile.orig 2008-12-10 09:05:08.000000000 +1000
+++ ./python/Makefile 2009-09-18 10:10:34.000000000 +1000
@@ -2,9 +2,11 @@ CXX? = g++
--- ./python/Makefile.orig 2009-09-16 23:37:45.000000000 +1000
+++ ./python/Makefile 2009-11-04 14:15:06.000000000 +1000
@@ -1,10 +1,12 @@
-CXX ?= g++
+CXX ? = g++
SWIG ?= swig
#Windows: see ../README ../Makefile.win
@ -187,8 +190,8 @@ diff -up ./python/Makefile.orig ./python/Makefile
LDFLAGS = -shared
# Mac OS
# LDFLAGS = -framework Python -bundle
@@ -15,16 +17,31 @@ svmc.so: svmc_wrap.o svm.o
$(CXX) $(LDFLAGS) -o svmc.so svmc_wrap.o svm.o
@@ -15,16 +17,31 @@ svmc.so: svmc_wrap.o ../svm.o
$(CXX) $(LDFLAGS) -o svmc.so svmc_wrap.o ../svm.o
svmc_wrap.o: svmc_wrap.c ../svm.h
- $(CXX) $(CFLAGS) -fPIC -c svmc_wrap.c
@ -197,14 +200,15 @@ diff -up ./python/Makefile.orig ./python/Makefile
svmc_wrap.c: svmc.i
$(SWIG) -python -noproxy svmc.i
svm.o: ../svm.cpp ../svm.h
- $(CXX) $(CFLAGS) -fPIC -c ../svm.cpp
+ $(CXX) $(CFLAGS_PYTHON) -fPIC -c ../svm.cpp
../svm.o: ../svm.cpp ../svm.h
- cd ..; $(CXX) $(CFLAGS) -fPIC -c svm.cpp
+ cd ..; $(CXX) $(CFLAGS_PYTHON) -fPIC -c svm.cpp
clean:
rm -f *~ *.o *.so *.pyc *.pyo svm.o
rm -f *~ *.o *.so *.pyc *.pyo
moreclean: clean
-cleaner: clean
+cleaner: clean
rm -f svmc_wrap.c
+
+
@ -223,7 +227,7 @@ diff -up ./python/Makefile.orig ./python/Makefile
+
diff -up ./svm-toy/gtk/callbacks.cpp.orig ./svm-toy/gtk/callbacks.cpp
--- ./svm-toy/gtk/callbacks.cpp.orig 2006-03-04 17:40:12.000000000 +1000
+++ ./svm-toy/gtk/callbacks.cpp 2009-09-18 10:10:34.000000000 +1000
+++ ./svm-toy/gtk/callbacks.cpp 2009-11-04 14:13:41.000000000 +1000
@@ -2,6 +2,7 @@
#include <stdio.h>
#include <ctype.h>
@ -234,7 +238,7 @@ diff -up ./svm-toy/gtk/callbacks.cpp.orig ./svm-toy/gtk/callbacks.cpp
#include "../../svm.h"
diff -up ./svm-toy/gtk/Makefile.orig ./svm-toy/gtk/Makefile
--- ./svm-toy/gtk/Makefile.orig 2007-10-14 16:29:12.000000000 +1000
+++ ./svm-toy/gtk/Makefile 2009-09-18 10:10:34.000000000 +1000
+++ ./svm-toy/gtk/Makefile 2009-11-04 14:13:41.000000000 +1000
@@ -2,21 +2,27 @@ CC? = gcc
CXX? = g++
CFLAGS = -Wall -O3 -g `gtk-config --cflags`
@ -273,7 +277,7 @@ diff -up ./svm-toy/gtk/Makefile.orig ./svm-toy/gtk/Makefile
+ rm -f *~ callbacks.o svm-toy-gtk main.o interface.o callbacks.o
diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile
--- ./svm-toy/qt/Makefile.orig 2008-12-19 16:42:05.000000000 +1000
+++ ./svm-toy/qt/Makefile 2009-09-18 10:10:34.000000000 +1000
+++ ./svm-toy/qt/Makefile 2009-11-04 14:13:41.000000000 +1000
@@ -1,17 +1,21 @@
CXX? = g++
-CFLAGS = -Wall -O3 -I$(INCLUDE) -I$(INCLUDE)/QtGui -lQtGui
@ -305,8 +309,8 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile
+ rm -f *~ svm-toy-qt svm-toy.moc ../../svm.o
diff -up ./tools/easy.py.orig ./tools/easy.py
--- ./tools/easy.py.orig 2009-01-14 07:13:26.000000000 +1000
+++ ./tools/easy.py 2009-09-18 10:10:34.000000000 +1000
--- ./tools/easy.py.orig 2009-05-14 15:09:29.000000000 +1000
+++ ./tools/easy.py 2009-11-04 14:13:41.000000000 +1000
@@ -2,6 +2,7 @@
import sys
@ -331,9 +335,17 @@ diff -up ./tools/easy.py.orig ./tools/easy.py
else:
# example for windows
diff -up ./tools/grid.py.orig ./tools/grid.py
--- ./tools/grid.py.orig 2008-08-08 20:41:11.000000000 +1000
+++ ./tools/grid.py 2009-09-18 10:10:34.000000000 +1000
@@ -11,7 +11,7 @@ from subprocess import *
--- ./tools/grid.py.orig 2009-05-14 15:09:29.000000000 +1000
+++ ./tools/grid.py 2009-11-04 14:13:41.000000000 +1000
@@ -1,7 +1,5 @@
#!/usr/bin/env python
-
-
import os, sys, traceback
import getpass
from threading import Thread
@@ -17,7 +15,7 @@ else:
is_win32 = (sys.platform == 'win32')
if not is_win32:
@ -342,11 +354,107 @@ diff -up ./tools/grid.py.orig ./tools/grid.py
gnuplot_exe = "/usr/bin/gnuplot"
else:
# example for windows
@@ -88,6 +88,7 @@ Usage: grid.py [-log2c begin,end,step] [
@@ -74,7 +72,7 @@ Usage: grid.py [-log2c begin,end,step] [
i = i + 1
fold = argv[i]
elif argv[i] in ('-c','-g'):
- print("Option -c and -g are renamed.")
+ print "Option -c and -g are renamed."
print(usage)
sys.exit(1)
elif argv[i] == '-svmtrain':
@@ -93,7 +91,8 @@ Usage: grid.py [-log2c begin,end,step] [
pass_through_options.append(argv[i])
i = i + 1
pass_through_string = join(pass_through_options," ")
- pass_through_string = " ".join(pass_through_options)
+ pass_through_string = " ".join(pass_through_options," ")
+ print 'dataset_pathname=%s' % dataset_pathname
assert os.path.exists(svmtrain_exe),"svm-train executable not found"
assert os.path.exists(gnuplot_exe),"gnuplot executable not found"
assert os.path.exists(dataset_pathname),"dataset not found"
@@ -127,7 +126,9 @@ def permute_sequence(seq):
def redraw(db,best_param,tofile=False):
if len(db) == 0: return
- begin_level = round(max(x[2] for x in db)) - 3
+ begin_level = round(max(x[2] for x in db)) - 3
+
+ begin_level = round(max(map(lambda(x):x[2],db))) - 3
step_size = 0.5
best_log2c,best_log2g,best_rate = best_param
@@ -158,12 +159,12 @@ def redraw(db,best_param,tofile=False):
gnuplot.write(("set label \"C = %s gamma = %s\""
" at screen 0.5,0.8 center\n" % (2**best_log2c, 2**best_log2g)).encode())
gnuplot.write("splot \"-\" with lines\n".encode())
-
-
-
-
+
+
+
+
db.sort(key = lambda x:(x[0], -x[1]))
-
+
prevc = db[0][0]
for line in db:
if prevc != line[0]:
@@ -222,9 +223,7 @@ class Worker(Thread):
if rate is None: raise "get no rate"
except:
# we failed, let others do that and we just quit
-
traceback.print_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])
-
self.job_queue.put((cexp,gexp))
print('worker %s quit.' % self.name)
break
@@ -251,8 +250,8 @@ class SSHWorker(Worker):
svmtrain_exe,c,g,fold,pass_through_string,dataset_pathname)
result = Popen(cmdline,shell=True,stdout=PIPE).stdout
for line in result.readlines():
- if str(line).find("Cross") != -1:
- return float(line.split()[-1][0:-1])
+ if find(line,"Cross") != -1:
+ return float(split(line)[-1][0:-1])
class TelnetWorker(Worker):
def __init__(self,name,job_queue,result_queue,host,username,password):
@@ -302,7 +301,6 @@ def main():
job_queue._put = job_queue.queue.appendleft
-
# fire telnet workers
if telnet_workers:
@@ -328,10 +326,8 @@ def main():
done_jobs = {}
-
result_file = open(out_filename, 'w')
-
db = []
best_rate = -1
best_c1,best_g1 = None,None
@@ -343,13 +339,14 @@ def main():
done_jobs[(c1,g1)] = rate
result_file.write('%s %s %s\n' %(c1,g1,rate))
result_file.flush()
+ print "[%s] %s %s %s" % (worker,c1,g1,rate),
if (rate > best_rate) or (rate==best_rate and g1==best_g1 and c1<best_c1):
best_rate = rate
best_c1,best_g1=c1,g1
best_c = 2.0**c1
best_g = 2.0**g1
print("[%s] %s %s %s (best c=%s, g=%s, rate=%s)" % \
- (worker,c1,g1,rate, best_c, best_g, best_rate))
+ (worker,c1,g1,rate, best_c, best_g, best_rate))
db.append((c,g,done_jobs[(c,g)]))
redraw(db,[best_c1, best_g1, best_rate])
redraw(db,[best_c1, best_g1, best_rate],True)

@ -1,12 +1,12 @@
Name: libsvm
Version: 2.89
Release: 4%{?dist}
Version: 2.90
Release: 1%{?dist}
Summary: A Library for Support Vector Machines
Group: Development/Libraries
License: BSD
URL: http://www.csie.ntu.edu.tw/~cjlin/libsvm/
Source0: %{name}-%{version}.tar.gz
Source0: %{name}-2.9.tar.gz
#Source0: http://www.csie.ntu.edu.tw/~cjlin/cgi-bin/libsvm.cgi?+http://www.csie.ntu.edu.tw/~cjlin/%{name}+tar.gz
Source1: http://www.csie.ntu.edu.tw/~cjlin/libsvm/log
Source2: http://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf
@ -108,7 +108,7 @@ svm-toy is a libsvm demostration program which has a qt-GUI to
display the derived separating hyperplane.
%prep
%setup -q
%setup -q -n libsvm-2.9
%patch0 -p0 -b .orig
cp %{SOURCE1} ChangeLog
cp %{SOURCE2} .
@ -222,6 +222,13 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Wed Nov 04 2009 Ding-Yi Chen <dchen@redhat.com> - 2.90-1
- Upstream update to 2.9, change to 2.90 for conveniently update.
+ tools/*.py can be run under python 3.0
+ svm_set_quiet() in python interface to disable outputs
+ check gamma < 0
+ internal functions to be static
* Fri Sep 18 2009 Ding-Yi Chen <dchen@redhat.com> - 2.89-4
- Fixed [Bug 524108] put libsvm.jar into _javadir
+ Move livsvm.jar to _javadir

15
log

@ -157,4 +157,17 @@ file updated.
issue a warning when -h 0 may be faster
2.89: 2009/04/01
todo: python 2.6, java 1.6, openMP, fast input
reduce input/loading time of svm-train/svm-predict by half
pointer function so users can specify their own outputs
remove info_flush()
a extern variable libsvm_version
svm-train -q option (disable outputs)
svm-scale: warning if more nonzero produced
easy.py: popel.communiate() to avoid some deadlock (if lots of
outputs when #classes is large)
2.9: 2009/11/?
tools/*.py can be run under python 3.0
svm_set_quiet() in python interface to disable outputs
check gamma < 0
internal functions to be static

@ -1,2 +1,2 @@
aae7a8f7e357e86e1c893b706bb02a63 guide.pdf
71975f20d37b30eb13a3ec8897f4f546 libsvm-2.89.tar.gz
c48109c825d8326d71c8c8564589736d libsvm-2.9.tar.gz

Loading…
Cancel
Save