public abstract class SequenceElement extends Object implements Comparable<SequenceElement>, Serializable
Modifier and Type | Field and Description |
---|---|
protected int |
codeLength |
protected List<Integer> |
codes |
protected com.google.common.util.concurrent.AtomicDouble |
elementFrequency |
protected org.nd4j.linalg.api.ndarray.INDArray |
historicalGradient |
protected int |
index |
protected List<Integer> |
points |
protected boolean |
special |
protected Long |
storageId |
Constructor and Description |
---|
SequenceElement() |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(SequenceElement o) |
boolean |
equals(Object object)
Equals method override should be properly implemented for any extended class, otherwise it will be based on label equality
|
int |
getCodeLength()
Returns Huffman code length.
|
List<Integer> |
getCodes()
Returns Huffman tree codes
|
double |
getElementFrequency()
This method returns SequenceElement's frequency in current training corpus.
|
double |
getGradient(int index,
double g) |
int |
getIndex()
Returns index in Huffman tree
|
abstract String |
getLabel()
This method should return string representation of this SequenceElement, so it can be used for
|
List<Integer> |
getPoints()
Returns Huffman tree points
|
int |
hashCode()
hashCode method override should be properly implemented for any extended class, otherwise it will be based on label hashCode
|
void |
increaseElementFrequency(int by)
Increases element frequency counter by argument
|
void |
incrementElementFrequency()
Increases element frequency counter by 1
|
void |
setCodeLength(int codeLength)
This method fills codes and points up to codeLength
|
void |
setCodes(List<Integer> codes)
Sets Huffman tree codes
|
void |
setElementFrequency(long value)
This method sets frequency value for this element
|
void |
setIndex(int index)
Sets index in Huffman tree
|
void |
setPoints(List<Integer> points)
Sets Huffman tree points
|
abstract String |
toJSON() |
String |
toString() |
protected com.google.common.util.concurrent.AtomicDouble elementFrequency
protected int index
protected org.nd4j.linalg.api.ndarray.INDArray historicalGradient
protected int codeLength
protected boolean special
protected Long storageId
public abstract String getLabel()
public double getElementFrequency()
public void setElementFrequency(long value)
value
- public void incrementElementFrequency()
public void increaseElementFrequency(int by)
by
- public boolean equals(Object object)
public int getIndex()
public void setIndex(int index)
index
- public int getCodeLength()
public void setCodeLength(int codeLength)
codeLength
- public double getGradient(int index, double g)
public int hashCode()
public int compareTo(SequenceElement o)
compareTo
in interface Comparable<SequenceElement>
public abstract String toJSON()
Copyright © 2016. All Rights Reserved.