|
This software is an extension of the SVMlight software (V6.01) available at http://svmlight.joachims.org/. It provides an interface to kernel functions that are implemented in Java by means of the Java Native Interface (JNI) Invocation API. Technically, the custom C/C++ kernel module of SVMlight now becomes a proxy that is tightly coupled to the Java class edu.unika.aifb.jnikernel.KernelManager. This class delegates all kernel evaluation calls to a user-specified Java class that implements the edu.unika.aifb.kernels.api.Kernel interface. Thus, SVMlight can directly (i.e. without further modifications) work with any Java class that implements this interface. A small disclaimer: To stick to the modular setup of SVMlight, all operations for converting C/C++ datatypes to Java and back are happening within the kernel interface and, as such, again and again during each kernel evaluation. Especially when dealing with large vectors, the repeated conversion to Java will result in a substantial computational overhead. For smaller vectors or for kernels defined on the custom String field of the SVMlight instances the conversion overhead is, however, neglectable. |
![]() |
#<comment>
<key><whitespace><value>
<key><whitepsace><value>
...
#JNI kernel extension parameter
jnikernel.class edu.unika.aifb.kernels.examples.Linear
#JNIparameters
jvm.option -Xmx256M
jvm.option -Djava.class.path=./jnikernel.jar
#other parameters (for the implementation)
#...
You can implement whatever kernel, just make sure that it implements the edu.unika.aifb.kernels.api.Kernel interface (check the corresponding JavaDoc for details: jnikernel-javadoc.tar.gz or online here). If parameters need to be passed to the kernel implementation, this can be done by implementing a constructor that takes a single java.util.Properties argument. The extension is implemented in such a way that during initialization, the KernelManager will check whether the implementing kernel class has a matching constructor. If so, it will pass the contents of the parameter file such that other, implementation-specific parameters can be read. If not, the default constructor will be used.
This extension can be freely used and modified but work based on this implementation should acknowledge this source by pointing to this website. When using the extension, please make sure that you comply with the (separate) license of the basic SVMlight software.
For any questions, please contact Stephan Bloehdorn. You might also like to have a look at the Semantic Kernel Extension for SVMlight available here.