Training

Configure, run, and monitor model training

MathExec compiles your formula to a PyTorch model and trains it on your connected dataset. Training runs on the backend and streams results in real-time.

Starting Training

Two ways to begin:

  1. Press Cmd+Enter — starts training if a formula and dataset are connected
  2. Open the training drawer (Cmd+Shift+T) and click Train

â„šī¸Note

Training requires both a recognized formula and a connected dataset. If only a formula exists, Cmd+Enter triggers recognition instead.

Training Drawer

The training drawer slides in from the right and shows configuration and results.

Configuration

SettingOptionsDefault
Epochs1 – 1000100
Learning Rate0.0001 – 1.00.01
Batch Size8 – 51232
OptimizerAdam, AdamW, SGD, RMSpropAdam
Loss FunctionCross-Entropy, MSE, MAE, HuberAuto-detected
Train/Test Split50% – 95%80%

💡Tip

The loss function is auto-detected based on your target column. Binary targets → Cross-Entropy. Continuous targets → MSE. You can override this manually.

Live Results

During training, the drawer shows:

  • Loss curve — real-time Plotly chart updated each epoch via SSE
  • Progress bar — current epoch / total epochs
  • ETA — estimated time remaining

Final Metrics

After training completes, metrics depend on the task type:

ClassificationRegression
AccuracyMSE
F1 ScoreMAE
PrecisionR2 Score
RecallRMSE

Background Jobs

Training runs as a background job. You can navigate away from the canvas tab — a toast notification appears when training completes. The experiment is saved automatically.

Exporting Code

Click Export Code in the training results to download a standalone Python file containing:

  • The PyTorch model class definition
  • Trained weights
  • Data loading and preprocessing code
  • A prediction function ready for production use