Learn the topological structure of the input data by building a
corresponding graph approximation (original Neural Gas algorithm).
Reference
The Neural Gas algorithm was originally published in Martinetz, T. and
Schulten, K.: A "Neural-Gas" Network Learns Topologies. In Kohonen, T.,
Maekisara, K., Simula, O., and Kangas, J. (eds.), Artificial Neural
Networks. Elsevier, North-Holland., 1991.
|
__init__(self,
num_nodes=10,
start_poss=None,
epsilon_i=0.3,
epsilon_f=0.05,
lambda_i=30.0,
lambda_f=0.01,
max_age_i=20,
max_age_f=200,
max_epochs=100,
n_epochs_to_train=None,
input_dim=None,
dtype=None)
Initializes an object of type 'NeuralGasNode'. |
|
|
list
|
|
|
|
|
|
|
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__
|
|
|
|
|
|
_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. |
|
|
|
|
|
__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. |
|
|
|
|
|
|
|
|