DJINN: Deep Jointly-Informed Neural Networks
DJINN builds an ensemble of neural networks from a random forest. Each decision tree sets the architecture of one network and its starting weights, and then the networks are trained with PyTorch. The trees do the work of designing the networks, so the only settings to tune are the number of trees and their depth. With dropout, the ensemble also gives uncertainty estimates.
DJINN was introduced by Humbird, Peterson and McClarren in Deep Neural Network Initialization With Decision Trees (arXiv). For an application, see Whewell and McClarren (2022), which used DJINN to reduce the data needed for neutron transport calculations.
Example
from djinn import DJINN_Regressor, load
# Fit a regression model and predict something new
model = DJINN_Regressor(n_trees=3, random_state=0)
model.fit(X, y)
y_new = model.predict(x_new)
# Save it, then reload and keep training on more data
model.save("my_model")
model = load("my_model")
model.continue_training(X1, y1, training_epochs=100,
learning_rate=0.005, batch_size=32)
Both models are scikit-learn estimators, so they can be used in
Pipeline, cross_val_score and GridSearchCV. Install with
pip install djinnml.
Getting started
Examples
Reference