{"id":26918,"library":"dynamic-network-architectures","title":"DynamicNetworkArchitectures","description":"A library for dynamic network architectures, including Deep Belief Networks and other configurable neural network structures. Version 0.4.3 supports Python 3.8+, focuses on flexible network building and training utilities. Release cadence is irregular.","status":"active","version":"0.4.3","language":"python","source_language":"en","source_url":"https://github.com/NeuroSYS-pl/dynamic-network-architectures","tags":["deep-belief-networks","restricted-boltzmann-machines","neural-networks","deep-learning","dynamic-architecture"],"install":[{"cmd":"pip install dynamic-network-architectures","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core dependency for tensor operations and neural network building blocks","package":"torch","optional":false},{"reason":"Used for numerical operations and data handling","package":"numpy","optional":false}],"imports":[{"note":"DeepBeliefNetwork is directly exposed at package level, not in models submodule","wrong":"from dynamic_network_architectures.models import DeepBeliefNetwork","symbol":"DeepBeliefNetwork","correct":"from dynamic_network_architectures import DeepBeliefNetwork"},{"note":"StackedRBMs is imported directly from the package root","wrong":"from dynamic_network_architectures.stacked_rbms import StackedRBMs","symbol":"StackedRBMs","correct":"from dynamic_network_architectures import StackedRBMs"}],"quickstart":{"code":"from dynamic_network_architectures import DeepBeliefNetwork\nimport torch\n\n# Create a simple Deep Belief Network\nmodel = DeepBeliefNetwork(\n    layers=[784, 500, 200],\n    learning_rate=0.01,\n    n_epochs=10,\n    batch_size=64\n)\n\n# Generate random data (e.g., MNIST-like)\ndata = torch.randn(64, 784)\n\n# Train the model\nmodel.fit(data)\n\n# Generate samples\nsamples = model.generate(n_samples=10)\nprint(samples.shape)","lang":"python","description":"Create and train a Deep Belief Network with random data."},"warnings":[{"fix":"Update to use simple integers for layer sizes, e.g., layers=[784, 500, 200].","message":"In version 0.4.0, the 'layers' parameter in DeepBeliefNetwork changed from list of dicts to list of ints. Old code with dict configurations will break.","severity":"breaking","affected_versions":"<0.4.0"},{"fix":"Replace n_gibbs_steps with chain_length: model.generate(n_samples, chain_length=10).","message":"The 'n_gibbs_steps' argument in DeepBeliefNetwork.generate() is deprecated in 0.4.3 and will be removed in next release. Use 'chain_length' instead.","severity":"deprecated","affected_versions":">=0.4.0"},{"fix":"Convert numpy arrays to torch tensors before calling fit().","message":"Training with mini-batches requires data to be a torch.Tensor. Passing bare numpy arrays to fit() will raise a TypeError.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use explicit import: from zipfile import ZipFile as ZipFileStd, or avoid importing dynamic_network_architectures after zipfile imports. Alternatively, import ZipFile directly from dynamic_network_architectures if that's intended.","cause":"Code attempts to open a .zip file using a function named 'ZipFile' conflicting with the Python standard library 'zipfile.ZipFile' after importing dynamic_network_architectures, which re-exports 'ZipFile' as a custom class.","error":"TypeError: 'ZipFile' object is not callable"},{"fix":"Import classes directly from the package: from dynamic_network_architectures import DeepBeliefNetwork, not from dynamic_network_architectures.models.","cause":"Attempt to import submodules that do not exist directly under that path. The package structure is flat; models are accessible at the package root.","error":"ModuleNotFoundError: No module named 'dynamic_network_architectures.models'"},{"fix":"Update to version 0.4.0+ and use model.fit(data). If pinned to older version, use model.train(data).","cause":"Using an older version (<0.4.0) where the method was named 'train'. In 0.4.0+, 'fit' replaced 'train'.","error":"AttributeError: 'DeepBeliefNetwork' object has no attribute 'fit'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}