public class SimnetUtils
extends java.lang.Object
Constructor and Description |
---|
SimnetUtils() |
Modifier and Type | Method and Description |
---|---|
static double |
findMaxEig(double[][] weightMatrix)
Find the largest eigenvalue for the provided matrix.
|
static java.util.List<java.util.List<Neuron>> |
getIntermedateLayers(Network network,
java.util.List<Neuron> sourceLayer,
java.util.List<Neuron> targetLayer)
Given a source and target set of neurons, find all layers of neurons
connecting them, as follows.
|
static java.awt.geom.Point2D |
getUpperLeft(java.util.List<java.lang.Object> objects)
Return the upper left corner of a list of objects, based on neurons.
|
static Synapse[][] |
getWeightMatrix(java.util.List<Neuron> srcLayer,
java.util.List<Neuron> targetLayer)
Gets a matrix of Synapse objects, formatted like the getWeights method.
|
static double[][] |
getWeights(java.util.List<Neuron> srcLayer,
java.util.List<Neuron> targetLayer)
Returns the weights connecting two lists of neurons as an N x M matrix of
doubles, where N is the number of source neurons, and M is the number of
target neurons.
|
static void |
printLayers(java.util.List<java.util.List<Neuron>> layers)
Prints a group of layers (a list of lists of neurons), typically for
debugging.
|
static void |
scaleEigenvalue(java.util.List<Neuron> src,
java.util.List<Neuron> tar,
double desiredEigen) |
static void |
scaleWeights(java.util.List<Neuron> src,
java.util.List<Neuron> tar,
double scalar)
Scales weights connecting source and target lists.
|
static void |
setWeights(java.util.List<Neuron> src,
java.util.List<Neuron> tar,
double[][] w)
Set the weights connecting two lists of neurons using a weight matrix.
|
public static double[][] getWeights(java.util.List<Neuron> srcLayer, java.util.List<Neuron> targetLayer)
srcLayer
- source layertargetLayer
- target layerpublic static void setWeights(java.util.List<Neuron> src, java.util.List<Neuron> tar, double[][] w)
src
- the list of source neuronstar
- the list of target neuronsw
- the new weight values for the network.public static Synapse[][] getWeightMatrix(java.util.List<Neuron> srcLayer, java.util.List<Neuron> targetLayer)
srcLayer
- source neuronstargetLayer
- target neuronspublic static void scaleWeights(java.util.List<Neuron> src, java.util.List<Neuron> tar, double scalar)
src
- source neuronstar
- target neuronsscalar
- scalar value which is multiplied by the weight matrixpublic static double findMaxEig(double[][] weightMatrix)
weightMatrix
- a matrix representation of the weights for use in
linear algebraic operationspublic static void scaleEigenvalue(java.util.List<Neuron> src, java.util.List<Neuron> tar, double desiredEigen)
src
- list of source neuronstar
- list of target neuronsdesiredEigen
- : the new max eig or spectral radius for the weight
matrixpublic static java.awt.geom.Point2D getUpperLeft(java.util.List<java.lang.Object> objects)
objects
- list of objectspublic static java.util.List<java.util.List<Neuron>> getIntermedateLayers(Network network, java.util.List<Neuron> sourceLayer, java.util.List<Neuron> targetLayer)
network
- the neural networksourceLayer
- the source neuronstargetLayer
- the target neuronspublic static void printLayers(java.util.List<java.util.List<Neuron>> layers)
layers
- the layers to print