fr.lip6.kernel
Class ThreadedKernel<T>
java.lang.Object
fr.lip6.kernel.Kernel<T>
fr.lip6.kernel.ThreadedKernel<T>
- Type Parameters:
T -
- All Implemented Interfaces:
- java.io.Serializable
public class ThreadedKernel<T>
- extends Kernel<T>
Simple multithreaded implementation over a given Kernel. The multithreading comes only when
computing the Gram matrix.
Number of Threads is function of available processors.
- Author:
- dpicard
- See Also:
- Serialized Form
| Fields inherited from class fr.lip6.kernel.Kernel |
name |
|
Method Summary |
double[][] |
getKernelMatrix(java.util.ArrayList<TrainingSample<T>> e)
return the Gram Matrix of this kernel computed on given samples |
double |
valueOf(T t1)
kernel similarity to zero |
double |
valueOf(T t1,
T t2)
compute the kernel similarity between two element of input space |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
numThread
protected int numThread
k
protected Kernel<T> k
ThreadedKernel
public ThreadedKernel(Kernel<T> kernel)
- MultiThread the given kernel
- Parameters:
kernel -
valueOf
public double valueOf(T t1,
T t2)
- Description copied from class:
Kernel
- compute the kernel similarity between two element of input space
- Specified by:
valueOf in class Kernel<T>
- Parameters:
t1 - first elementt2 - second element
- Returns:
- the kernel value
valueOf
public double valueOf(T t1)
- Description copied from class:
Kernel
- kernel similarity to zero
- Specified by:
valueOf in class Kernel<T>
- Parameters:
t1 - the element to compute the similarity to zero
getKernelMatrix
public double[][] getKernelMatrix(java.util.ArrayList<TrainingSample<T>> e)
- Description copied from class:
Kernel
- return the Gram Matrix of this kernel computed on given samples
- Overrides:
getKernelMatrix in class Kernel<T>
- Returns:
- double[][] containing similarities in the order of the e.