neuralfn-python-sdk

Construct, manipulate, and execute NeuralFn neuron graphs with the neuralfn Python package.

2|Updated Mar 25, 2026
One-click install
npx skills add https://github.com/adamdroberts/NeuralFn --skill neuralfn-python-sdk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: neuralfn-python-sdk
Source: https://github.com/adamdroberts/NeuralFn/tree/main/.cursor/skills/neuralfn-python-sdk
Command: npx skills add https://github.com/adamdroberts/NeuralFn --skill neuralfn-python-sdk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a concise, code-first way to construct, validate, execute, and train neuron graphs using the neuralfn Python package so developers can avoid low-level boilerplate, inconsistent graph wiring, and error-prone serialization when building custom neural architectures.

Core Features & Use Cases

  • Programmatic Graph Construction: Create NeuronDef instances, NeuronInstance placements, and Edge connections to define arbitrary directed neuron graphs.
  • Multi-runtime Training & Execution: Support for scalar (function) execution, Torch module nodes, surrogate/evolutionary/hybrid training workflows, and PyTorch-backed TorchTrainer flows for large models.
  • Serialization & Variant Libraries: Save/load graphs, round-trip to dict, resolve variant libraries, and export/import module state for checkpointing and deployment.
  • Use Case: Quickly prototype a small neural graph for XOR with surrogate training, or assemble a GPT-style root graph using the provided presets and train via the Torch runtime.

Quick Start

Create a NeuronGraph with input, sigmoid, and output nodes, execute it with sample scalar inputs, then save the graph to a JSON file.

Frequently Asked Questions about neuralfn-python-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build and train neural network graphs in Python without manual boilerplate?

You can programmatically construct neural network graphs in Python by defining NeuronDef instances, placing NeuronInstance nodes, and wiring Edge connections. This approach avoids manual boilerplate and inconsistent graph wiring when building custom neural architectures.

Can I train PyTorch neural networks using a custom graph structure?

Yes, you can train PyTorch neural networks using custom graph structures via the TorchTrainer runtime. It supports assembling GPT-style root graphs with presets and executing large model training flows natively within the PyTorch ecosystem.

What is the best way to prototype a small neural graph for logical operations like XOR?

The best way to prototype a small neural graph for XOR is using surrogate training workflows. You construct a directed neuron graph with input, sigmoid, and output nodes, then execute it with scalar function inputs to validate behavior.

Does the neural graph execution support both scalar functions and PyTorch modules?

Neural graph execution supports both scalar function runtimes and PyTorch module nodes. This multi-runtime capability allows you to execute simple scalar inputs for prototyping and switch to torch-backed execution for large model training.

How do I serialize a neural graph for checkpointing and deployment?

Neural graph serialization allows you to save and load NeuronGraph structures by round-tripping them to a dictionary format or JSON file. You can resolve variant libraries and export module state for checkpointing and deployment.