Skip to content
 
 

Repository files navigation

GMLDatasets

Documentation

Dataset-backed demonstrations for GeometricMachineLearning and GeometricOptimizers.

Both of those packages are libraries for scientific machine learning and neither should depend on an image-dataset package to document itself. This package holds everything that does: the MLDatasets glue, the MNIST and Fashion-MNIST demonstrations, and the numerical experiment from brantner2023generalizing that shows manifold optimization making a vision transformer trainable at all.

What is in here

src/ is a thin layer between MLDatasets and GeometricMachineLearning.DataLoader:

using GMLDatasets

dl      = mnist_data_loader(:train; patch_length = 7)
dl_test = mnist_data_loader(:test;  patch_length = 7)

mnist_data_loader cuts each 28\times28 image into 16 patches of 7\times7, flattens each patch into a column, and one-hot encodes the labels — the time series format a transformer wants. The pieces are also available on their own: split_and_flatten, onehotbatch, mnist, fashion_mnist, and a DataLoader(images, labels) constructor.

scripts/ holds the training runs, split by which package they exercise:

  • scripts/gml/ — written against GeometricMachineLearning, so they get DataLoader, ClassificationTransformer and the optimizers from the library. The training runs write a .jld2 and plot_mnist_results.jl draws the loss-curve figures from it, so a figure can be redrawn without repeating four configurations of 500 epochs.
  • scripts/geometric_optimizers/ — written against GeometricOptimizers alone, with the neural network spelled out by hand. GeometricMachineLearning depends on GeometricOptimizers, so these cannot use it. Host, CUDA and Metal variants.

docs/ builds the MNIST tutorial and the figures for the numerical experiment. The figures are drawn from CSVs checked in under docs/src/data/, so building the documentation needs neither a GPU nor a rerun.

Installation

Not registered, and it needs GeometricMachineLearning at 0.5, which is not tagged yet — the newest registered version still defines split_and_flatten and onehotbatch itself and would collide with this package. That is also why Julia 1.11 is the floor: Project.toml pins GeometricMachineLearning to main through a [sources] block, which is a 1.11 feature, and Pkg 1.10 ignores it and resolves to the registered 0.4.8 instead. Both go back to 1.10 when 0.5 lands. So until it does:

using Pkg
Pkg.develop(url = "https://github.com/JuliaGNI/GeometricMachineLearning.jl")
Pkg.develop(url = "https://github.com/JuliaGNI/GMLDatasets.jl.git")

or, working from local checkouts side by side:

using Pkg
Pkg.activate("GMLDatasets")
Pkg.develop(path = "../GeometricMachineLearning")

License

MIT, see LICENSE.md.

About

Demonstrating GeometricMachineLearning.jl on common machine learning datasets

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages