|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectFacemorph.pga.MultiSpherePGA
public class MultiSpherePGA
Principal Geodesic Analysis for hyperspherical data (Experimental, only part completed)
| Constructor Summary | |
|---|---|
MultiSpherePGA()
Creates a new instance of SpherePGA |
|
MultiSpherePGA(java.util.Vector<double[]> data,
int length,
double tol)
Creates a new instance of SpherePGA |
|
| Method Summary | |
|---|---|
static void |
addToAverage(double[] average,
double[] b,
int n)
Adds b to the average as the n-th component |
double[] |
analyse(double[] v)
Analyses the vector using PGA |
static double |
dotProduct(double[] a,
double[] b,
int start,
int len)
Calculates the dot product of part of the vectors a and b |
void |
estimateMean(java.util.Vector<double[]> data,
double tol)
Estimates the intrinsic mean iteratively, until the ||mean||^2 |
double[] |
fold(double[] v)
Folds the vector v from the tangent space into the manifold |
double[] |
getMean()
Return the current estimate of the mean |
static double |
getMean(double[] v,
int start,
int len)
Get the mean of a sub-vector |
static double |
length(double[] vec,
int start,
int len)
Get the length of a sub-vector |
static void |
main(java.lang.String[] args)
The main method is used for testing |
static void |
normalise(double[] vec,
int vlen)
Subtract the mean of the sub-vector's coords and normlise length to 1 |
void |
read(java.io.InputStream is)
Read from the input stream |
double[] |
reconstruct(double[] v)
reconstructs from a set of weightings |
void |
setCount(int c)
Set the number of the component for the model |
static void |
subtractMean(double[] v,
double mean,
int start,
int len)
Subtract the mean sub-vector from another sub-vector |
double[] |
unfold(double[] v)
Unfolds a sample into the tangent plane |
void |
write(java.io.Writer w)
Write to the Writer specified |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MultiSpherePGA()
public MultiSpherePGA(java.util.Vector<double[]> data,
int length,
double tol)
data - the data vectors to build the SpherePGA fromlength - the length of each subvector (assume all the same length)tol - tolerence factor for intrinsic mean convergence| Method Detail |
|---|
public void write(java.io.Writer w)
throws java.io.IOException
w - the Writer to write to
java.io.IOExceptionpublic void read(java.io.InputStream is)
is - the input stream to read frompublic void setCount(int c)
c - public double[] analyse(double[] v)
v - the vector to analyse
public double[] reconstruct(double[] v)
v - the vector of weights
public void estimateMean(java.util.Vector<double[]> data,
double tol)
data - the set of data vectors to calculate the mean fromtol - the tolerance used to indicate convergencepublic double[] getMean()
public static void addToAverage(double[] average,
double[] b,
int n)
average - the current (n-sample) estimate of the averageb - the new vector to addn - the number of samples in the current average estimate
public static double dotProduct(double[] a,
double[] b,
int start,
int len)
a - vector ab - vector bstart - the start position to start averaging fromlen - the number of components to dot together
public double[] unfold(double[] v)
v - the sample to unfold
public double[] fold(double[] v)
v - the tangent space vector v to fold
public static double length(double[] vec,
int start,
int len)
vec - the vector containing the sub-vectorstart - the start position of the sub-vectorlen - the length of the sub-vector
public static double getMean(double[] v,
int start,
int len)
v - the vector containing the sub-vectorstart - the start position of the sub-vectorlen - the length of the sub-vector
public static void subtractMean(double[] v,
double mean,
int start,
int len)
v - the vector containing the sub-vectormean - the mean vectorstart - the start of the sub-vectorlen - the length of the sub-vector
public static void normalise(double[] vec,
int vlen)
vec - the vector to normalise, made up from a number of sub-vectorsvlen - the length of each sub-vectorpublic static void main(java.lang.String[] args)
args -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||