A Torch package for creating and visualizing complex neural network architectures using graph-based computation.
nngraph is a Torch package that provides graph-based computation for the nn library, allowing developers to construct complex neural network architectures by treating individual nn modules as nodes in a computational graph. It solves the problem of designing intricate network topologies—like multi-input models or networks with skip connections—by enabling intuitive module chaining and visualization. The package integrates with Graphviz to generate visual representations of both forward and backward computation graphs.
Torch users and researchers building complex neural network architectures who need intuitive design tools and visualization capabilities for debugging and documentation.
Developers choose nngraph for its ability to simplify the creation of sophisticated neural networks using graph semantics, coupled with built-in visualization and debugging tools that are not readily available in standard nn usage.
Graph Computation for nn
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows chaining nn modules with operators like `-` and `__call__` to build complex topologies, such as multi-input networks, as shown in the MLP examples with skip connections.
Integrates with Graphviz to generate SVG or DOT files for forward and backward computation graphs, aiding debugging and documentation, demonstrated with `graph.dot` in the README.
Enables automatic creation of annotated SVG graphs with error highlighting when runtime errors occur using `nngraph.setDebug(true)`, as illustrated in the debugging section.
Supports labeling nodes with names and Graphviz attributes for clarity in large graphs, allowing customization of colors and styles, shown in the annotations example.
Requires Graphviz installation for graph visualization features, adding setup complexity and potential incompatibility in some environments, as noted in the requirements.
The graph-based approach introduces additional complexity and performance overhead compared to direct nn usage, making it overkill for simple sequential networks.
Mastering graph semantics and operators like `__unm__` can be challenging for users accustomed to standard nn, requiring adaptation to a declarative style.