|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.ep.State<T,U>
public class State<T extends Payload<U>,U>
Records evolutionary state and provides a mutation operation for recorded-step meta-mutation. You provide the payload, this class provides the mutation operations. During mutation, the payload is copied and after the state variables are changed, they are passed to the payload. Parameters are internally mutated in a state space that spans all of R^n, but parameters passed to the payload are transformed as specified by a call to setMap(). The default mapping is the identity map, but uniform-ish or exponential-ish coverage of a range are also supported. More information on the underlying algorithm can be found in the following paper http://arxiv.org/abs/0803.3838
Mapping
Constructor Summary | |
---|---|
State()
|
|
State(double[] x0,
double omni)
Invent a new state with no momentum (yet). |
Method Summary | |
---|---|
int |
compareTo(State<T,U> other)
Natural order is to sort in descending order of score. |
State<T,U> |
copy()
Deep copies a state, useful in mutation. |
boolean |
equals(Object o)
|
double |
get(int i)
Returns a transformed parameter. |
int |
getId()
|
double[] |
getMappedParams()
Returns all the parameters in mapped form. |
Mapping[] |
getMaps()
|
double |
getOmni()
|
double[] |
getParams()
|
T |
getPayload()
|
double[] |
getStep()
|
double |
getValue()
|
int |
hashCode()
|
State<T,U> |
mutate()
Clones this state with a random change in position. |
void |
readFields(DataInput input)
|
void |
setId(int id)
|
void |
setMap(int i,
Mapping m)
Defines the transformation for a parameter. |
void |
setMaps(Iterable<Mapping> maps)
|
void |
setMaps(Mapping[] maps)
|
void |
setOmni(double omni)
|
void |
setPayload(T payload)
|
void |
setStep(double[] step)
|
void |
setValue(double v)
|
String |
toString()
|
void |
write(DataOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public State()
public State(double[] x0, double omni)
Method Detail |
---|
public State<T,U> copy()
public State<T,U> mutate()
public void setMap(int i, Mapping m)
i
- Which parameter's mapping to define.m
- The mapping to use.Mapping
public double get(int i)
i
- The parameter to return.
public int getId()
public double[] getParams()
public Mapping[] getMaps()
public double[] getMappedParams()
public double getOmni()
public double[] getStep()
public T getPayload()
public double getValue()
public void setOmni(double omni)
public void setId(int id)
public void setStep(double[] step)
public void setMaps(Mapping[] maps)
public void setMaps(Iterable<Mapping> maps)
public void setValue(double v)
public void setPayload(T payload)
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public int compareTo(State<T,U> other)
compareTo
in interface Comparable<State<T extends Payload<U>,U>>
other
- The state to compare with.
public String toString()
toString
in class Object
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public void readFields(DataInput input) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |