public class ConnectionUtilities
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
ConnectionUtilities.SynapseParameterGetter<T>
A functional interface that is intended to check/return the value of some
parameter(s) of a(some) synapse(s).
|
static interface |
ConnectionUtilities.SynapseParameterSetter<T>
A functional interface that is intended to be used to set some parameter
of the synapse to the specified value.
|
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_EXCITATORY_STRENGTH
The default excitatory strength.
|
static double |
DEFAULT_INHIBITORY_STRENGTH
The default inhibitory strength.
|
Constructor and Description |
---|
ConnectionUtilities() |
Modifier and Type | Method and Description |
---|---|
static void |
applyLearningRules(SynapseUpdateRule exciteRule,
SynapseUpdateRule inhibRule,
java.util.List<Synapse> synapses) |
static void |
conformToTemplates(java.util.Collection<Synapse> synapses,
Synapse exTemplateSynapse,
Synapse inTemplateSynapse)
Makes the synapses in the given collection conform to the parameters of
the given template synapses, which are essentially information ferries.
|
static java.util.ArrayList<Synapse> |
getExcitatorySynapses(java.util.Collection<Synapse> synapses) |
static java.util.ArrayList<Synapse> |
getInhibitorySynapses(java.util.Collection<Synapse> synapses) |
static void |
polarizeSynapses(java.util.Collection<Synapse> synapses,
double excitatoryRatio)
Changes all the synapses in a given collection such that
excitatoryRatio of them are excitatory and 1 -
excitatoryRatio of them are inhibitory, assigning default strengths
respectively to each.
|
static void |
randomizeAndPolarizeSynapses(java.util.Collection<Synapse> synapses,
double excitatoryRatio)
Randomize and polarize synapses using default excitatory and inhibitory
polarizers (uniform 0 to 1).
|
static void |
randomizeAndPolarizeSynapses(java.util.Collection<Synapse> synapses,
PolarizedRandomizer exciteRand,
PolarizedRandomizer inhibRand,
double excitatoryRatio)
Randomizes a collection of synapses based on excitatory and inhibitory
(polarized appropriately) randomizers, which cannot be the same
randomizer.
|
static void |
randomizeExcitatorySynapses(java.util.Collection<Synapse> synapses,
PolarizedRandomizer exciteRand)
Randomizes the excitatory synapses in the given list of synapses using
the given excitatory randomizer.
|
static void |
randomizeExcitatorySynapsesUnsafe(java.util.Collection<Synapse> synapses,
PolarizedRandomizer exciteRand)
Randomizes the given synapses using the given excitatory randomizer
without checking first to make sure that the given synapses or their
source neurons are not inhibitory.
|
static void |
randomizeInhibitorySynapses(java.util.Collection<Synapse> synapses,
PolarizedRandomizer inhibRand)
Randomizes the inhibitory synapses in the given list of synapses using
the given inhibitory randomizer.
|
static void |
randomizeInhibitorySynapsesUnsafe(java.util.Collection<Synapse> synapses,
PolarizedRandomizer inhibRand)
Randomizes the given synapses using the given inhibitory randomizer
without checking first to make sure that the given synapses or their
source neurons are not excitatory.
|
static void |
randomizeSynapses(java.util.Collection<Synapse> synapses,
PolarizedRandomizer exciteRand,
PolarizedRandomizer inhibRand) |
static boolean |
testRecurrence(java.util.List<Neuron> sourceNeurons,
java.util.List<Neuron> targetNeurons)
Tests whether or not these connections are recurrent, that is, whether or
not the neurons in the source list are the same as those in the target
list.
|
public static final double DEFAULT_EXCITATORY_STRENGTH
public static final double DEFAULT_INHIBITORY_STRENGTH
public static void randomizeAndPolarizeSynapses(java.util.Collection<Synapse> synapses, PolarizedRandomizer exciteRand, PolarizedRandomizer inhibRand, double excitatoryRatio) throws java.lang.IllegalArgumentException
exciteRand
- the randomizer to be used to determine the weights of excitatory synapses.inhibRand
- the randomizer to be used to determine the weights of inhibitory synapses.excitatoryRatio
- the ration of excitatory to inhibitory synapses.synapses
- the synapses to modifyjava.lang.IllegalArgumentException
public static void randomizeAndPolarizeSynapses(java.util.Collection<Synapse> synapses, double excitatoryRatio)
randomizeAndPolarizeSynapses(Collection, PolarizedRandomizer,
PolarizedRandomizer, double)
synapses
- the synapses to modifyexcitatoryRatio
- the ration of excitatory to inhibitory synapses.public static void randomizeSynapses(java.util.Collection<Synapse> synapses, PolarizedRandomizer exciteRand, PolarizedRandomizer inhibRand)
synapses
- the synapses to modifyexciteRand
- the randomizer to be used to determine the weights of excitatory synapses.inhibRand
- the randomizer to be used to determine the weights of inhibitory synapses.public static void randomizeExcitatorySynapses(java.util.Collection<Synapse> synapses, PolarizedRandomizer exciteRand)
synapses
- the synapses to modifyexciteRand
- the randomizer to be used to determine the weights of excitatory synapses.public static void randomizeExcitatorySynapsesUnsafe(java.util.Collection<Synapse> synapses, PolarizedRandomizer exciteRand)
synapses
- the synapses to modifyexciteRand
- the randomizer to be used to determine the weights of excitatory synapses.public static void randomizeInhibitorySynapses(java.util.Collection<Synapse> synapses, PolarizedRandomizer inhibRand)
synapses
- the synapses to modifyinhibRand
- the randomizer to be used to determine the weights of inhibitory synapses.public static void randomizeInhibitorySynapsesUnsafe(java.util.Collection<Synapse> synapses, PolarizedRandomizer inhibRand)
synapses
- the synapses to modifyinhibRand
- the randomizer to be used to determine the weights of inhibitory synapses.public static java.util.ArrayList<Synapse> getExcitatorySynapses(java.util.Collection<Synapse> synapses)
synapses
- the synapses to modifypublic static java.util.ArrayList<Synapse> getInhibitorySynapses(java.util.Collection<Synapse> synapses)
synapses
- the synapses to modifypublic static void polarizeSynapses(java.util.Collection<Synapse> synapses, double excitatoryRatio)
synapses
- the synapses to polarizeexcitatoryRatio
- the ration of excitatory synapses (1 for all
exctitatory)public static void conformToTemplates(java.util.Collection<Synapse> synapses, Synapse exTemplateSynapse, Synapse inTemplateSynapse)
synapses
- the synpases to modifyexTemplateSynapse
- temporary set containing all excitatory synapsesinTemplateSynapse
- temporary set containing all inhibitory synapsespublic static boolean testRecurrence(java.util.List<Neuron> sourceNeurons, java.util.List<Neuron> targetNeurons)
sourceNeurons
- the starting neuronstargetNeurons
- the targeted neuronspublic static void applyLearningRules(SynapseUpdateRule exciteRule, SynapseUpdateRule inhibRule, java.util.List<Synapse> synapses)
exciteRule
- inhibRule
- synapses
-