Skip to content

Latest commit

 

History

History
59 lines (35 loc) · 1.81 KB

README.md

File metadata and controls

59 lines (35 loc) · 1.81 KB

Cloudtropy

Empirical probability mass functions and entropies of N-dimensional clouds of points, as seen in

Onesto, V., M. Romano, F. Gentile, and F. Amato. "Relating the small world coefficient to the entropy of 2D networks and applications in neuromorphic engineering." Journal of Physics Communications 3, no. 9 (2019): 095011.

Install

Simply

pip install cloudtropy

Quick Start

Given an array X of M points in N dimensions (X.shape-> M,N)

get the N-dimensional grid object and the probability mass function on the elements of the grid

 import cloudtropy as ctpy
 grid,pmf = ctpy.pmf(X)

which you can then use in graphics, for example if N=2:

 fig = plt.figure(figsize=(4,3))
 ax = fig.add_subplot(1,1,1)
 cs = ax.contourf(grid[0], grid[1], pmf, cmap='Purples_r')
 ax.axis('equal')
 cbar = fig.colorbar(cs)
 plt.show()

or to compute its entropy:

 ctpy.entropy(X)
 >>> 8.4976

but, in order to compare entropies between clouds you should read the reference, or the code documentation.

Acknowledgements

This work has been partially funded by the French National Agency for Research under grant ANR-19-CE38-0006 "Geometry of Public Issues" (GOPI).