This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Tool: edge2torch — flexible PyTorch models for knowledge-primed neural networks

Knowledge-primed neural networks are neural networks whose architecture is informed by prior biological knowledge. Related terms include visible neural networks and biologically informed neural networks.

The basic idea is intuitive: if genes, proteins, regulators, pathways, or phenotypes are already connected in a biological knowledge graph, those connections can also define the sparse connectivity of a neural network. This can make the model less arbitrary and can help interpretation and deliver scientific insights, because intermediate nodes in the model can correspond to named biological entities.

This is an active area of research, but it is still a niche workflow. From a practical software perspective, building these models is often tedious: one has to convert a biological network into a neural network architecture, preserve node names, align input features correctly, and ensure that the sparse connectivity is implemented as intended.

I released edge2torch v0.1.0 to make this step easier.

edge2torch is a small open-source Python package that compiles edge lists of named nodes into PyTorch models with graph-defined sparse connectivity. It is intended as a reusable software layer rather than a complete biological analysis pipeline.

It can:

  • compile source -> target edge lists into PyTorch nn.Module models
  • preserve named input, hidden, and output nodes
  • align input data features by name
  • support optional edge-level initial weights and constraints
  • support feedforward, recurrent, and minimal graph-style backends
  • optionally map attributions back to named features and nodes

There is existing code in this research area, but much of it is either tied to a specific workflow/database or is research-grade code from individual papers. edge2torch tries to provide a more general and flexible graph-to-model compilation layer for people who want to experiment with knowledge-primed / visible / biologically informed neural network architectures in PyTorch.

Documentation

GitHub

PyPI

Feedback from people working with pathway-informed models, biological networks, or interpretable neural networks would be useful.

software python machine-learning neural-networks systems-biology

0 answers

No answers yet.

Log in to answer this question.