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
|
int |
getMaxSubseqLeng() |
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)
Deprecated.
|
void |
setLambda(float lambda) |
void |
setMaxSubseqLeng(int maxSubseqLeng) |
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 similarity@Deprecated public void setDeltaMatrix(DeltaMatrix deltaMatrix)
deltaMatrix
- public void setLambda(float lambda)
public void setMu(float mu)
public void setTerminalFactor(float terminalFactor)
public int getMaxSubseqLeng()
public void setMaxSubseqLeng(int maxSubseqLeng)
maxSubseqLeng
- The maximum length of common subsequences considered in the
recursion. It reflects the maximum branching factor allowed to
the tree fragments.Copyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.