public class PartialTreeKernel extends DirectKernel<TreeRepresentation>
representation
Constructor and Description |
---|
PartialTreeKernel()
Default constructor.
|
PartialTreeKernel(float LAMBDA,
float MU,
float terminalFactor,
String representationIdentifier)
A Constructor for the Partial Tree Kernel in which parameters can be set
manually.
|
PartialTreeKernel(String representationIdentifier)
This constructor by default uses lambda=0.4, mu=0.4, terminalFactor=1
|
Modifier and Type | Method and Description |
---|---|
float |
evaluateKernelNotNormalize(TreeRepresentation a,
TreeRepresentation b)
Evaluate the Partial Tree Kernel
|
DeltaMatrix |
getDeltaMatrix() |
float |
getLambda()
Get the Vertical Decay factor
|
float |
getMu()
Get the Horizontal Decay factor
|
float |
getTerminalFactor()
Get the Terminal Factor
|
float |
kernelComputation(TreeRepresentation repA,
TreeRepresentation repB)
Computes the kernel similarity between two specific representations
|
void |
setDeltaMatrix(DeltaMatrix deltaMatrix) |
void |
setLambda(float lambda) |
void |
setMu(float mu) |
void |
setTerminalFactor(float terminalFactor) |
getRepresentation, kernelComputation, setRepresentation
disableCache, getKernelCache, getKernelComputations, getNumberOfHits, getNumberOfMisses, getSquaredNormCache, innerProduct, load, reset, save, setKernelCache, setSquaredNormCache, squaredNorm, squaredNormOfTheDifference
public PartialTreeKernel()
public PartialTreeKernel(float LAMBDA, float MU, float terminalFactor, String representationIdentifier)
LAMBDA
- lambda value in the PTK formulaMU
- mu value of the PTK formulaterminalFactor
- terminal factorrepresentationIdentifier
- the representation on which operatepublic PartialTreeKernel(String representationIdentifier)
public float evaluateKernelNotNormalize(TreeRepresentation a, TreeRepresentation b)
a
- First treeb
- Second Treepublic DeltaMatrix getDeltaMatrix()
public float getLambda()
public float getMu()
public float getTerminalFactor()
public float kernelComputation(TreeRepresentation repA, TreeRepresentation repB)
DirectKernel
kernelComputation
in class DirectKernel<TreeRepresentation>
repA
- the first representation in the kernel similarityrepB
- the second representation in the kernel similaritypublic void setDeltaMatrix(DeltaMatrix deltaMatrix)
public void setLambda(float lambda)
public void setMu(float mu)
public void setTerminalFactor(float terminalFactor)
Copyright © 2015 Semantic Analytics Group @ Uniroma2. All rights reserved.