NODENetwork<T>
Models & Types · AiDotNet.NeuralNetworks.Tabular
NODE (Neural Oblivious Decision Ensembles) neural network for tabular data.
Inheritance: NeuralNetworkBase<T> → TabularNeuralNetworkBase<T> → NODENetwork<T>
For Beginners
NODE brings the interpretability of decision trees to deep learning:
Architecture:
- Feature Preprocessing: Optional batch normalization and feature transformation
- Oblivious Trees: Trees where all nodes at the same depth use the same feature
- Soft Splits: Differentiable split decisions using entmax for sparse attention
- Ensemble Aggregation: Multiple tree outputs combined for final prediction
Key insight: Traditional trees are hard to train with gradient descent. NODE uses soft, differentiable splits that allow end-to-end training while maintaining tree-like interpretability.
Example flow:
Features [batch, num_features] → Preprocessing [batch, hidden]
→ Tree 1 [batch, tree_out]
→ Tree 2 [batch, tree_out] → Aggregate → Prediction
→ Tree N [batch, tree_out] /
How It Works
NODE combines differentiable oblivious decision trees with neural network training. Oblivious trees use the same splitting feature at all nodes of the same depth, making them both interpretable and efficient. This implementation follows the standard neural network architecture pattern with:
- Proper inheritance from NeuralNetworkBase
- Layer-based architecture using ILayer components
- Engine-based tensor operations for CPU/GPU acceleration
- Full autodiff and JIT compilation support
Reference: “Neural Oblivious Decision Ensembles for Deep Learning on Tabular Data” (2019)
Example
var architecture = new NeuralNetworkArchitecture<float>(inputFeatures: 8, outputSize: 4);
var options = new NODEOptions<double> { NumFeatures = 20, NumTrees = 1024, TreeDepth = 6 };
var input = Tensor<float>.CreateRandom(new[] { 1, 20 });
var trainX = Tensor<float>.CreateRandom(4, 8);
var trainY = Tensor<float>.CreateRandom(4, 2);
var result = new AiModelBuilder<float, Tensor<float>, Tensor<float>>()
.ConfigureModel(new NODENetwork<float>(architecture))
.Build(trainX, trainY);
var output = result.Predict(input);
Constructors
| Constructor | Summary |
|---|---|
NODENetwork() |
Initializes a new NODE network with the specified architecture. |
NODENetwork(NeuralNetworkArchitecture<T> architecture, NODEOptions<T> options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer, ILossFunction<T> lossFunction) |
Properties
| Property | Summary |
|---|---|
NODEOptions<T> Options { get; } |
Gets the NODE-specific options. |
int NumLeaves { get; } |
Gets the number of leaf nodes per tree. |
int NumTrees { get; } |
Gets the number of trees in the ensemble. |
int TreeDepth { get; } |
Gets the tree depth. |
Methods
| Method | Summary |
|---|---|
Dictionary<string, T> GetFeatureImportance() |
|
ModelMetadata<T> GetModelMetadata() |