UML diagram of the network implementation
The implementation favors clarity over efficiency - it implements both σ and boundary states as separate classes, and is not optimized for performance. A crucial detail for the implementation of the learning rule is that - in line with the our formal framework - the predictive (anti-Hebbian) term uses the previous state of the network, before the new biases (novel input/evidence) were applied.
import subprocess
from IPython.display import Image, display
# Run pyreverse to generate a single UML diagram focusing on State classes, ignoring others
subprocess.run(['pyreverse',
'-o', 'png',
'--colorized',
'-p', 'network_state', # Project name
'-ASmy', # Show Attributes, Methods, builtins, associations
'simulation/network.py'])
# Display the generated UML diagram
display(Image(filename='classes_network_state.png')) # Match project name
Format png is not supported natively. Pyreverse will try to generate it using Graphviz...
