K-Veritas
Tutorials

Framework tutorials

Each tutorial is a complete training script that loads real data, adds a few K-Veritas directives, and seals a report you can verify. Pick your framework.

PyTorchPyTorch: MNISTImage classificationA small convolutional network on the real MNIST dataset, downloaded through torchvision. Shows the seed, model card, phases, per-epoch metrics, and a final claim.PyTorchPyTorch: KMNISTImage classificationA small convolutional network on KMNIST (Kuzushiji-MNIST), a drop-in but harder replacement for MNIST made of cursive Japanese characters, downloaded through torchvision.PyTorch LightningPyTorch Lightning: MNISTImage classificationThe MNIST task written as a LightningModule. A Lightning callback forwards the training loss, and the test metric is printed after Trainer.test.TensorFlow / KerasKeras: Fashion-MNISTImage classificationA Keras CNN on Fashion-MNIST. A one-method Keras callback forwards every metric in the training logs, so no manual metric lines are needed inside the loop.TensorFlow / KerasKeras: IMDB textText classificationIMDB sentiment with a Keras embedding model. Shows the same callback pattern on a text task loaded from keras.datasets.scikit-learnscikit-learn: classificationTabular classificationAn SVM pipeline tuned with GridSearchCV on the breast-cancer dataset, then scored on a held-out split. Records the cross-validation best score and the test accuracy and F1.scikit-learnscikit-learn: regressionRegressionGradient-boosted regression on California housing. Records RMSE and R2 on the held-out split and commits R2 as the claim.XGBoostXGBoost: digitsTabular classificationXGBoost with early stopping on the digits dataset, using a validation split to pick the best iteration. Records the chosen iteration and the test accuracy.LightGBMLightGBM: covertypeTabular classificationLightGBM with early stopping on a subsample of the real Covertype forest-cover dataset. Shows the same tabular pattern on a larger, multiclass problem.Hugging Face TransformersHugging Face: DistilBERTText classificationFine-tune DistilBERT on an IMDB subset with the Trainer API. A TrainerCallback forwards the eval metrics; the datasets library loads the data locally and nothing about it leaves your machine.

New to the directives? Start with Instrument your script.