MxNetLib 1.1.2

.NET Standard 2.0 .NET Framework 4.6
Suggested Alternatives


Install-Package MxNetLib -Version 1.1.2
dotnet add package MxNetLib --version 1.1.2
<PackageReference Include="MxNetLib" Version="1.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MxNetLib --version 1.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MxNetLib, 1.1.2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install MxNetLib as a Cake Addin
#addin nuget:?package=MxNetLib&version=1.1.2

// Install MxNetLib as a Cake Tool
#tool nuget:?package=MxNetLib&version=1.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.


Apache MXNet (incubating) is a deep learning framework designed for both efficiency and flexibility. It allows you to mix symbolic and imperative programming to maximize efficiency and productivity. At its core, MXNet contains a dynamic dependency scheduler that automatically parallelizes both symbolic and imperative operations on the fly. A graph optimization layer on top of that makes symbolic execution fast and memory efficient. MXNet is portable and lightweight, scaling effectively to multiple GPUs and multiple machines.

MXNet is more than a deep learning project. It is a collection of blue prints and guidelines for building deep learning systems, and interesting insights of DL systems for hackers.

mxnetlib is a CSharp binding coving all the Imperative and Symbolic API's with an easy to use interface. Also developed a high level interface to build and train model.

Setup MxNet for Windows:


Install the package: Install-Package MxNetLib

Symbolic Example


var x = Symbol.Variable("X");
var fc1 = sym.Relu(sym.FullyConnected(x, Symbol.Variable("fc1_w"), 128));
var fc2 = sym.Relu(sym.FullyConnected(fc1, Symbol.Variable("fc2_w"), 128));
var fc3 = sym.FullyConnected(fc2, Symbol.Variable("fc3_w"), 10);
var output = sym.SoftmaxOutput(fc3, Symbol.Variable("label"), symbol_name: "model");

model.SetDefaultInitializer(new RandomUniform(-1, 1));
model.Compile(output, OptimizerRegistry.SGD(), MetricType.Accuracy);

High Level API Example


model.Add(new Dense(128, ActivationType.ReLU, kernalInitializer: new RandomUniform(-1, 1)));
model.Add(new Dense(128, ActivationType.ReLU, kernalInitializer: new RandomUniform(-1, 1)));
model.Add(new Dense(10));

model.Compile(OptimizerRegistry.SGD(), LossType.SoftmaxCategorialCrossEntropy, MetricType.Accuracy);

Train and Inference

//Training for 10 epoch
model.Fit(train, 10, batchSize, val);

//Load test data
ImageDataFrame frame = new ImageDataFrame(1, 28, 28);
frame.LoadImages("test_6.png", "test_4.png", "test_4.png", "test_6.png");
NDArray test = frame.ToVariable().Ravel() / 255;

// Predict
var prediction = model.Predict(test).Argmax();

Saving and Loading model and checkpoint

string modelFolder = "../../../model";

var loadedModel = Module.LoadModel(modelFolder);
Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net46 net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.2 712 6/7/2019
1.1.0 368 6/5/2019
1.0.6 380 5/10/2019
1.0.5 389 5/10/2019