Learn the topological structure of the input data by building a
corresponding graph approximation.
The algorithm expands on the original Neural Gas algorithm
(see mdp.nodes NeuralGasNode) in that the algorithm adds new nodes are
added to the graph as more data becomes available. Im this way,
if the growth rate is appropriate, one can avoid overfitting or
underfitting the data.
Reference
More information about the Growing Neural Gas algorithm can be found in
B. Fritzke, A Growing Neural Gas Network Learns Topologies, in G. Tesauro,
D. S. Touretzky, and T. K. Leen (editors), Advances in Neural Information
Processing Systems 7, pages 625-632. MIT Press, Cambridge MA, 1995.
|
__init__(self,
start_poss=None,
eps_b=0.2,
eps_n=0.006,
max_age=50,
lambda_=100,
alpha=0.5,
d=0.995,
max_nodes=2147483647,
input_dim=None,
dtype=None)
Initializes an object of type 'GrowingNeuralGasNode'. |
|
|
|
|
|
|
|
_get_nearest_nodes(self,
x)
Return the two nodes in the graph that are nearest to x and their
squared distances. |
|
|
|
_insert_new_node(self)
Insert a new node in the graph where it is more necessary (i.e.
where the error is the largest). |
|
|
|
_move_node(self,
node,
x,
eps)
Move a node by eps in the direction x. |
|
|
|
|
|
|
|
|
|
|
tuple
|
nearest_neighbor(self,
input)
Assign each point in the input data to the nearest node in
the graph. Return the list of the nearest node instances, and
the list of distances. |
|
|
|
train(self,
input)
Update the internal structures according to the input data x . |
|
|
Inherited from unreachable.newobject :
__long__ ,
__native__ ,
__nonzero__ ,
__unicode__ ,
next
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__ ,
__sizeof__ ,
__subclasshook__
|
|
|
|
__call__(self,
x,
*args,
**kwargs)
Calling an instance of Node is equivalent to calling
its execute method. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_refcast(self,
x)
Helper function to cast arrays to the internal dtype. |
|
|
|
|
|
|
|
|
|
copy(self,
protocol=None)
Return a deep copy of the node. |
|
|
|
execute(self,
x,
*args,
**kwargs)
Process the data contained in x . |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inverse(self,
y,
*args,
**kwargs)
Invert y . |
|
|
|
is_training(self)
Return True if the node is in the training phase,
False otherwise. |
|
|
|
save(self,
filename,
protocol=-1)
Save a pickled serialization of the node to filename .
If filename is None, return a string. |
|
|
|
set_dtype(self,
t)
Set internal structures' dtype. |
|
|
|
|
|
|
|
|