NewT123-WM/tnlearn

A Python package that uses task-based neurons to build neural networks.

What it solves

Tnlearn addresses the limitation that most artificial neural networks rely on a single, uniform type of neuron. Inspired by the biological diversity of neurons in the human brain, this project enables the design and implementation of "task-based" neurons that are specifically optimized for the inductive bias of a given task, potentially improving feature representation and model performance.

How it works

The library uses symbolic regression to discover optimal mathematical formulas that fit input data. These formulas are then parameterized to create learnable aggregation functions for neurons. Users can search for these task-specific expressions using various methods—including genetic programming, reinforcement learning, or LLMs—and then integrate the resulting neurons into a standard MLP (Multi-Layer Perceptron) architecture for training.

Who it’s for

This project is for machine learning researchers and practitioners interested in neural architecture search, neuro-inspired computing, and improving model performance on tabular data through custom, task-specific activation or aggregation functions.

Highlights

  • Supports multiple search strategies for finding optimal neuron expressions: Genetic Programming (GPSymRegressor), Reinforcement Learning (RLSymRegressor), Polynomial Tensor methods, and LLM-based discovery.
  • Seamlessly integrates discovered neurons into PyTorch-based MLP models.
  • Provides a flexible API for defining and training models with custom, learned neuron designs.
  • Demonstrates competitive performance against state-of-the-art tabular learning methods like XGBoost and TabNet on real-world datasets.

Related

  • Project
  • Project
  • Project
  • Project
  • Project