Counting 3,146 Big Data & Machine Learning Frameworks, Toolsets, and Examples...
Suggestion? Feedback? Tweet @stkim1

Last Commit
Sep. 20, 2018
Oct. 23, 2017

Build Status Backers on Open Collective Sponsors on Open Collective Join the chat at

A C# deep learning wrapper with CNTK backend

Developing a C# wrapper to help developer easily create and train deep neural network models. I am working on enhancing the interface to load data, build model, train and predict.

Install using NuGet

GPU and CPU Version:

For better performance on CPU please use CPU only version. CPU Only Version:

Load dataset (Housing regression example)

DataFrame frame = new DataFrame();


var xy = frame.SplitXY(14, new[] { 1, 13 });

traintest = xy.SplitTrainTest(0.25);

Load Sample Dataset (MNIST)


var samplePath = Downloader.GetSamplePath(SampleDataset.MNIST);

train = ImageDataGenerator.FlowFromText(samplePath.Train);

validation = ImageDataGenerator.FlowFromText(samplePath.Test);

Build Model

model = new Sequential();

model.Add(new Dense(13, 12, OptActivations.ReLU));

model.Add(new Dense(13, OptActivations.ReLU));

model.Add(new Dense(1));

Build Convolution Layers

model.Add(new Conv2D(Tuple.Create(imageDim[0], imageDim[1], imageDim[2]), 4, Tuple.Create(3, 3), Tuple.Create(2, 2), activation: OptActivations.None, weightInitializer: OptInitializers.Xavier, useBias: true, biasInitializer: OptInitializers.Ones));

model.Add(new MaxPool2D(Tuple.Create(3, 3)));

model.Add(new Conv2D(8, Tuple.Create(3, 3), Tuple.Create(2, 2), activation: OptActivations.None, weightInitializer: OptInitializers.Xavier));

model.Add(new MaxPool2D(Tuple.Create(3, 3)));

model.Add(new Dense(numClasses));

Configure Training callbacks

model.OnEpochEnd += Model_OnEpochEnd;

model.OnTrainingEnd += Model_OnTrainingEnd;

model.OnBatchEnd += Model_OnBatchEnd;

Train Model

model.Compile(OptOptimizers.Adam, OptLosses.MeanSquaredError, OptMetrics.MAE, Regulizers.RegL2(0.1)); model.Train(traintest.Train, 64, 200, traintest.Test);

API Documentation:

Examples Docs (More to add)

Help me improve this project



This project exists thanks to all the people who contribute. [Contribute].


Thank you to all our backers! ­čÖĆ [Become a backer]


Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

Latest Releases
Release v0.3.0
 Nov. 29 2017
First Beta Release 0.2.2
 Nov. 14 2017