Package network.aika
Class Model
- java.lang.Object
-
- network.aika.Model
-
public class Model extends java.lang.ObjectThe model consists of two layers. The first layer is the actual neural network consisting of neurons and synapses. The second layer is a pattern lattice containing a boolean logic representation of all the neurons. Whenever the synapse weights of a neuron are adjusted, then the underlying boolean logic representation of this neuron will be updated too.The model supports parallel processing using a fixed number of threads.
- Author:
- Lukas Molzberger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceModel.LinkerFactorystatic interfaceModel.WritableFactory
-
Field Summary
Fields Modifier and Type Field Description java.util.Map<java.lang.Integer,Provider<? extends AbstractNode>>activeProvidersjava.util.concurrent.atomic.AtomicIntegercurrentIdintdefaultThreadIdjava.util.concurrent.atomic.AtomicIntegerdocIdCounterDocument[]docsint[]lastCleanupModel.LinkerFactorylinkerFactoryintnumberOfThreadsjava.util.Map<java.lang.Integer,PassiveInputFunction>passiveActivationFunctionsjava.util.WeakHashMap<java.lang.Integer,java.lang.ref.WeakReference<Provider<? extends AbstractNode>>>providersSearchNode.SkipSelectStepskipSelectStepSuspensionHooksuspensionHookstatic java.util.concurrent.atomic.AtomicLongvisitedCounter
-
Constructor Summary
Constructors Constructor Description Model()Creates a model with a single thread.Model(SuspensionHook sh, int numberOfThreads)
-
Method Summary
-
-
-
Field Detail
-
numberOfThreads
public int numberOfThreads
-
lastCleanup
public int[] lastCleanup
-
docs
public Document[] docs
-
suspensionHook
public SuspensionHook suspensionHook
-
linkerFactory
public Model.LinkerFactory linkerFactory
-
skipSelectStep
public SearchNode.SkipSelectStep skipSelectStep
-
docIdCounter
public java.util.concurrent.atomic.AtomicInteger docIdCounter
-
currentId
public java.util.concurrent.atomic.AtomicInteger currentId
-
providers
public java.util.WeakHashMap<java.lang.Integer,java.lang.ref.WeakReference<Provider<? extends AbstractNode>>> providers
-
activeProviders
public java.util.Map<java.lang.Integer,Provider<? extends AbstractNode>> activeProviders
-
passiveActivationFunctions
public java.util.Map<java.lang.Integer,PassiveInputFunction> passiveActivationFunctions
-
defaultThreadId
public int defaultThreadId
-
visitedCounter
public static java.util.concurrent.atomic.AtomicLong visitedCounter
-
-
Constructor Detail
-
Model
public Model()
Creates a model with a single thread.
-
Model
public Model(SuspensionHook sh, int numberOfThreads)
-
-
Method Detail
-
getSuspensionHook
public SuspensionHook getSuspensionHook()
-
setSuspensionHook
public void setSuspensionHook(SuspensionHook suspensionHook)
-
getNeuronExtensionFactory
public Model.WritableFactory getNeuronExtensionFactory()
-
setNeuronExtensionFactory
public void setNeuronExtensionFactory(Model.WritableFactory neuronExtensionFactory)
-
getSynapseExtensionFactory
public Model.WritableFactory getSynapseExtensionFactory()
-
setSynapseExtensionFactory
public void setSynapseExtensionFactory(Model.WritableFactory synapseExtensionFactory)
-
getActivationExtensionFactory
public Model.WritableFactory getActivationExtensionFactory()
-
setActivationExtensionFactory
public void setActivationExtensionFactory(Model.WritableFactory activationExtensionFactory)
-
getLinkerFactory
public Model.LinkerFactory getLinkerFactory()
-
setLinkerFactory
public void setLinkerFactory(Model.LinkerFactory linkerFactory)
-
getSkipSelectStep
public SearchNode.SkipSelectStep getSkipSelectStep()
-
setSkipSelectStep
public void setSkipSelectStep(SearchNode.SkipSelectStep skipSelectStep)
-
createNeuron
public Neuron createNeuron()
-
createNeuron
public Neuron createNeuron(java.lang.String label)
-
createNeuron
public Neuron createNeuron(java.lang.String label, java.lang.String outputText)
-
createNeuron
public Neuron createNeuron(java.lang.String label, java.lang.String outputText, INeuron.Type type, ActivationFunction actF)
-
createDocument
public Document createDocument(java.lang.String txt)
-
createDocument
public Document createDocument(java.lang.String txt, int threadId)
-
lookupNeuron
public Neuron lookupNeuron(int id)
-
register
public void register(Provider p)
-
unregister
public void unregister(Provider p)
-
suspendUnusedNodes
public void suspendUnusedNodes(int docId, Provider.SuspensionMode sm)Suspend all neurons and logic nodes whose last used document id is lower/older than docId.- Parameters:
docId-
-
getOldestDocIdInProcessing
public int getOldestDocIdInProcessing()
-
suspendAll
public void suspendAll(Provider.SuspensionMode sm)
Suspend all neurons and logic nodes in memory.
-
removeProvider
public void removeProvider(Provider p)
-
-