|
Sautrela | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.gtts.sautrela.engine.AbstractDataProcessor
edu.gtts.sautrela.vq.CodebookTrainer
public class CodebookTrainer
A Dataprocessor that implements the LBG algorithm (and the eLBG
variant). Due to the nature of the Vector Quantization, only DoubleData
elements are processed (IntData and ShortData are
discarted). The processor buffers the input data untill a DataClose is received.
Then, the LBG/eLBG algorithm is applied and the resulting codebook is saved in a
File (using a Sequence representation).
| Field Summary | |
|---|---|
static boolean |
DEFAULT_BINCDBK
Default flag for binary Codebook == false |
static int |
DEFAULT_CBKSIZE
Default size for final codebook == 256 |
static double |
DEFAULT_DELTA
Default value for convergence factor == 1e-10 |
static boolean |
DEFAULT_ELBG
Default flag for eLBG == true |
static boolean |
DEFAULT_INCREMENTAL
Default flag for incremental LBG == false |
static int |
DEFAULT_MAXITER
Default maximun number of iterations == 100 |
| Fields inherited from interface java.beans.BeanInfo |
|---|
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32 |
| Constructor Summary | |
|---|---|
CodebookTrainer()
Creates a new CodebookTrainer |
|
| Method Summary | |
|---|---|
void |
editBeanInfo(java.beans.BeanInfo info)
|
int |
getCodebookSize()
Gets the Codebook's final size |
double |
getDelta()
Gets the convergence factor. |
java.io.File |
getFinalCodebook()
Gets the final Codebook File |
java.net.URL |
getInitCodebook()
Gets the initial Codebook's URL |
int |
getMaxIter()
Gets the maximun number of iterations |
boolean |
isBinaryCodebook()
Getter for property binaryCodebook. |
boolean |
isELBG()
Return true if eLBG algorithm is used |
boolean |
isIncremental()
Return true if codebook size is enlarged incrementally |
static void |
main(java.lang.String[] args)
|
void |
process(Buffer in,
Buffer out)
Meaningfull data ( DoubleData) is stored untill a (CloseData)
is received. |
void |
setBinaryCodebook(boolean binaryCodebook)
Setter for property binaryCodebook. |
void |
setCodebookSize(int size)
Sets the Codebook's final size |
void |
setDelta(double delta)
Sets the convergence factor. |
void |
setELBG(boolean flag)
Sets the flag for eLBG algorithm. |
void |
setFinalCodebook(java.io.File file)
Sets the final Codebook File |
void |
setIncremental(boolean flag)
Sets the flag for incremental codebook enlargement. |
void |
setInitCodebook(java.net.URL url)
Sets the initial Codebook's URL. |
void |
setMaxIter(int n)
Sets the maximun number of iterations |
| Methods inherited from class edu.gtts.sautrela.engine.AbstractDataProcessor |
|---|
getAdditionalBeanInfo, getBeanDescriptor, getDefaultEventIndex, getDefaultPropertyIndex, getEventSetDescriptors, getIcon, getMethodDescriptors, getName, getPropertyDescriptors, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_CBKSIZE
public static final double DEFAULT_DELTA
public static final int DEFAULT_MAXITER
public static final boolean DEFAULT_ELBG
public static final boolean DEFAULT_INCREMENTAL
public static final boolean DEFAULT_BINCDBK
| Constructor Detail |
|---|
public CodebookTrainer()
DataProcessor,
ClusterSet| Method Detail |
|---|
public java.net.URL getInitCodebook()
public void setInitCodebook(java.net.URL url)
null, a random one is generated
url - The initial Codebook's URLpublic boolean isBinaryCodebook()
public void setBinaryCodebook(boolean binaryCodebook)
binaryCodebook - New value of property binaryCodebook.public java.io.File getFinalCodebook()
public void setFinalCodebook(java.io.File file)
file - The final Codebook Filepublic int getCodebookSize()
public void setCodebookSize(int size)
size - The Codebook's final sizepublic boolean isIncremental()
public void setIncremental(boolean flag)
flag - The incremental flagpublic double getDelta()
public void setDelta(double delta)
(dist_old-dist_new)/dist_new <= delta
delta - The the convergence factorpublic int getMaxIter()
public void setMaxIter(int n)
n - The maximun number of iterationspublic boolean isELBG()
public void setELBG(boolean flag)
flag - The flag for eLBG algorithm
public void process(Buffer in,
Buffer out)
throws DataProcessorException
DoubleData) is stored untill a (CloseData)
is received. Then, the LBG algorithm is performed and the obtained codebook
is written to a file as a sequence if a finalCodebook is
given and saved in the cdbk variable if it is not null.
in - Input Bufferout - Output Buffer
DataProcessorExceptionpublic void editBeanInfo(java.beans.BeanInfo info)
editBeanInfo in class AbstractDataProcessor
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
|
Sautrela | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||