public class Model extends Object implements Writable
| Modifier and Type | Class and Description |
|---|---|
static class |
Model.Statistic |
| Modifier and Type | Field and Description |
|---|---|
Set<Node>[] |
allNodes |
Document[] |
docs |
int[] |
documentCounter |
Map<Integer,Node> |
initialNodes |
Map<String,Neuron> |
labeledNeurons |
int[] |
lastCleanup |
Map<Integer,Neuron> |
neurons |
int |
numberOfPositions |
Set<AndNode> |
numberOfPositionsQueue |
int |
numberOfThreads |
Model.Statistic |
stat |
| Constructor and Description |
|---|
Model()
Creates a model with a single thread.
|
Model(int numberOfThreads) |
| Modifier and Type | Method and Description |
|---|---|
Neuron |
createAndNeuron(Neuron n,
double threshold,
Collection<Input> inputs)
Creates a neuron representing a conjunction of its inputs.
|
Neuron |
createAndNeuron(Neuron n,
double threshold,
Input... inputs)
Creates a neuron representing a conjunction of its inputs.
|
Neuron |
createCounterNeuron(Neuron n,
Neuron clockSignal,
boolean dirCS,
Neuron startSignal,
boolean dirSS,
boolean direction)
A counter neuron is used to compute the relational id.
|
Document |
createDocument(String txt) |
Document |
createDocument(String txt,
int threadId) |
Neuron |
createNeuron(Neuron n,
double bias,
Collection<Input> inputs)
Creates a neuron with the given bias.
|
Neuron |
createNeuron(Neuron n,
double bias,
Input... inputs)
Creates a neuron with the given bias.
|
InputNeuron |
createOrLookupInputNeuron(String label)
Creates an
InputNeuron with the given label. |
InputNeuron |
createOrLookupInputNeuron(String label,
boolean isBlocked) |
Neuron |
createOrNeuron(Neuron n,
Input... inputs)
Creates a neuron representing a disjunction of its inputs.
|
Neuron |
createOrNeuron(Neuron n,
Set<Input> inputs)
Creates a neuron representing a disjunction of its inputs.
|
Neuron |
createRelationalNeuron(Neuron n,
Neuron ctn,
Neuron inputSignal,
boolean dirIS)
A relational neuron combines the relational id created by a counter neuron with an input signal.
|
String |
networkWeightsToString(boolean all) |
static Model |
read(DataInput in) |
void |
readFields(DataInput in,
Document doc)
Deserialize the fields of this object from
in. |
void |
reset() |
void |
resetFrequency() |
String |
toString() |
void |
write(DataOutput out)
Serialize the fields of this object to
out. |
public int numberOfThreads
public int[] lastCleanup
public int[] documentCounter
public Document[] docs
public Model.Statistic stat
public volatile int numberOfPositions
public Model()
public Model(int numberOfThreads)
public void reset()
public void resetFrequency()
public String networkWeightsToString(boolean all)
public InputNeuron createOrLookupInputNeuron(String label)
InputNeuron with the given label.label - public InputNeuron createOrLookupInputNeuron(String label, boolean isBlocked)
public Neuron createAndNeuron(Neuron n, double threshold, Input... inputs)
n - threshold - A value between 0 and 1, determining how sensitive the resulting neuron will be.inputs - public Neuron createAndNeuron(Neuron n, double threshold, Collection<Input> inputs)
n - threshold - A value between 0 and 1, determining how sensitive the resulting neuron will be.inputs - public Neuron createNeuron(Neuron n, double bias, Input... inputs)
n - bias - inputs - public Neuron createNeuron(Neuron n, double bias, Collection<Input> inputs)
n - bias - inputs - public Neuron createOrNeuron(Neuron n, Input... inputs)
n - inputs - public Neuron createOrNeuron(Neuron n, Set<Input> inputs)
n - inputs - public Neuron createRelationalNeuron(Neuron n, Neuron ctn, Neuron inputSignal, boolean dirIS)
n - ctn - inputSignal - dirIS - public Neuron createCounterNeuron(Neuron n, Neuron clockSignal, boolean dirCS, Neuron startSignal, boolean dirSS, boolean direction)
n - clockSignal - dirCS - The direction of the clock signal.startSignal - dirSS - The direction of the start signal.direction - public void write(DataOutput out) throws IOException
Writableout.write in interface Writableout - DataOuput to serialize this object into.IOExceptionpublic void readFields(DataInput in, Document doc) throws IOException
Writablein.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields in interface Writablein - DataInput to deseriablize this object from.IOExceptionpublic static Model read(DataInput in) throws IOException
IOExceptionCopyright © 2017. All rights reserved.