1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
package detection; component SpectralClusterer<N1 n = 50, N1 elements
= 2500, N1 k = 4, N1 maximumClusters = 1>{ ports in Q(-oo:oo)^{n,n} img[3], out Q(-oo:oo)^{elements,
maximumClusters} cluster; instance
Similarity
<n> similarity; instance
NormalizedLaplacian
<elements> normalizedLaplacian; instance
EigenSolver
<elements,
k> eigenSolver; instance
KMeansClustering
<elements, k, maximumClusters> kMeansClustering; connect img[:] -> similarity.img[:]; connect similarity.degree -> normalizedLaplacian.degree; connect similarity.similarity -> normalizedLaplacian.similarity; connect normalizedLaplacian.nLaplacian -> eigenSolver.matrix; connect eigenSolver.eigenvectors -> kMeansClustering.vectors; connect kMeansClustering.cluster -> cluster; } |