Skip to main content

Construct epsilon-machines to generate symbol sequences with ground truth causal structure and information-theoretic complexity for studying neural network learning dynamics.

Project description

A-Machine

A-Machine is a library for constructing epsilon-machines1 and other stochastic models for generating structured symbol sequences. It was created with the goal of generating data with ground truth causal structure and information-theoretic complexity for studying neural network learning dynamics and internal representations.

See the documentation for more details.

This is an early work in progress. Much more to come.

Installation

# CPU only
pip install a-machine

# With GPU support (requires CUDA 13)
pip install "a-machine[cuda]" --extra-index-url https://pypi.nvidia.com

Quick Start

import amachine as am

# Seeds random and np.random globally (alternatively pass a random seed directly to random_machine)
am.srand_global( 42 )

# May have multiple recurrent subgraphs, terminal states, or tranistory states
m = am.random_machine( 
	n_states=23, 
	symbols=[ '0', '1' ],
	connectedness=0.35,
	randomness=0.25 )

# Collapse to the largest recurrent subgraph
m.collapse_to_largest_strongly_connected_subgraph()

# Minimize the machine in case it's not minimal -> epsilon-machine.
m.minimize( retain_names=True )

# Single symbol entropy, entropy rate, Statistical complexity
print( f"H(1) : {m.H_1():.3f}" )
print( f"h_mu : {m.h_mu():.3f}" )
print( f"C_mu : {m.C_mu():.3f}" )

# Excess entropy, transient information, synchronization information 
print( f"E : {m.E():.3f}" )
print( f"T : {m.T_inf():.3f}" )
print( f"S : {m.S():.3f}" )

# Crypticity
print( f"chi : {m.chi():.3f}" )

# Display the epislon machine
m.draw_graph(output_dir=".")

Author

Tyson A. Neuroth

tneuroth.gitlab.io

Citation

If you use this package in your research, please cite:

@software{a-machine,
  author = {Tyson A. Neuroth},
  title  = {A-Machine},
  year   = {2016},
  url    = {https://gitlab.com/tneuroth/a-machine}
}

License

MIT

References

  1. Crutchfield, James P., and Karl Young. "Inferring statistical complexity." Physical review letters 63.2 (1989): 105.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

a_machine-0.2.1.tar.gz (5.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

a_machine-0.2.1-cp312-cp312-manylinux_2_34_x86_64.whl (144.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

Details for the file a_machine-0.2.1.tar.gz.

File metadata

  • Download URL: a_machine-0.2.1.tar.gz
  • Upload date:
  • Size: 5.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for a_machine-0.2.1.tar.gz
Algorithm Hash digest
SHA256 acc68afa2a2e3fb901bf661e83dd232e7e9759992d4cbe963a1f3129dcb77bf4
MD5 ac55cdb6aefd7f5d9685641f4887f13d
BLAKE2b-256 6c507680e100d6eebe99a867e6825b34896a82a9ccf1485fc69aca46d18ae875

See more details on using hashes here.

File details

Details for the file a_machine-0.2.1-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for a_machine-0.2.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 fd4fe5baacf77c1e1617e0e4781d2131be9ead9534d2a9f307b6354fb64adba5
MD5 6967e7acb3b74390152a17da4e59d5ba
BLAKE2b-256 ed19ebee0d551944a276895fa7104a4d3565c99ac3f3c8b86627a7ca4a7fa597

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page