I wanted to showcase the project I have been working on for the past 4 years and the progress I have made so far. The work is mostly completed but I have some remaining performance issues that I want to focus on some model families such as audio AI models. I was hoping to get some feedback and overall show everyone how easy it is to use this library to create AI models with basically no experience necessary. You could literally pass in input and output such as data you have such as stock prices and output such as the actual prices that you would like to predict and you receive a fully trained AI model you could easily host with AiDotNet.Serving or save locally and run it on demand.
I would love to get your thoughts on my passion project and a reminder that it is 100% C# and open source so feel free to contribute if you would like. We have our website at www.aidotnet.dev with easy examples and guides.
Here is an easy example of how to use the library and the configuration options you get:
using AiDotNet;
using AiDotNet.Data.Loaders;
using AiDotNet.Models.Results;
using AiDotNet.Regression;
using AiDotNet.Tensors.LinearAlgebra;
// Five days of closing prices for a fictional stock.
double[] days = [ 1, 2, 3, 4, 5];
double[] prices = [100, 102, 104, 106, 108];
// Give the builder the examples and let it learn the trend.
var model =
await new AiModelBuilder<double, Matrix<double>, Vector<double>>()
.ConfigureModel(new SimpleRegression<double>())
.ConfigureDataLoader(DataLoaders.FromArrays(days, prices))
.BuildAsync();
// Ask the trained model what price it expects on day 6.
var daySix = new Matrix<double>(new double[,] { { 6 } });
double predictedPrice = model.Predict(daySix)[0];
Console.WriteLine($"Predicted closing price for day 6: ${predictedPrice:F2}");
Tested with AiDotNet 0.234.0 on .NET 10. It prints:
Predicted closing price for day 6: $110.00
This is a super easy example but with ConfigureModel here are over 2,100 model types in the library. To get a feel for the range, the repo includes examples for finding objects in a photo, adapting an existing language model to your own material, and packaging a trained model for another app to use. Browse the examples
What you’re seeing in the 17-second video. We trained the same LSTM model in AiDotNet and PyTorch. Each got a separate turn on the same laptop graphics card, starting from the same model settings and seeing the same examples in the same order. Both had eight practice updates before the clock started. The two recordings play side by side at actual speed.
| After 4,096 training updates | AiDotNet | PyTorch |
|---|
| Time on a GeForce GTX 1660 Ti | 2.60 seconds | 15.00 seconds |
| Correct answers on 320 new signals | 302 | 301 |