NewT123-WM/tnlearn
A Python package that uses task-based neurons to build neural networks.
What it solves
Tnlearn addresses the problem of designing neural networks with fixed, generic neurons (like ReLU or sigmoid) that may not fit every task well. Instead of only tweaking network architecture, it proposes generating task-based neurons — neurons whose mathematical form is automatically discovered to match the data. This aims to improve feature representation and prediction accuracy, especially on tabular data.
How it works
The library uses symbolic regression to find mathematical formulas that best fit the input data. These formulas are then parameterized (weights and biases added) to become trainable neurons. A neural network (MLP) is built using these neurons as its building blocks. Two approaches are included:
- VecSymRegressor: a vectorized symbolic regression method that directly searches for formulas.
- DrSR (LLMSymRegressor): uses a large language model (LLM) to reason about and propose candidate equations iteratively, refining them with optimization. It supports providers like DeepSeek, SiliconFlow, and local Ollama models.
The resulting neuron expressions (e.g., polynomial or interaction terms) are exported as strings and used to construct custom MLP layers.
Who it's for
Researchers and practitioners working on tabular regression or classification problems who want to explore more flexible neuron designs. It's also useful for anyone interested in combining symbolic regression, LLM-based equation discovery, and neural network training.
Highlights
- Generates task-based neurons via vectorized symbolic regression, avoiding hand-crafted activation functions.
- Supports LLM-assisted symbolic regression (DrSR) for discovering interpretable equations from data.n- Integrates discovered neurons into a standard MLP regressor with custom hidden layers.
- Benchmarks on real-world datasets (particle collision, asteroid prediction) show lower MSE than XGBoost, LightGBM, and TabNet.
- Apache 2.0 license and easy pip installation.
相關
- 專案
- 專案
- 專案
- 專案